如何让 intellij 的 clojure 控制台加载 leiningen 中定义的依赖项?

发布于 2024-11-26 11:11:45 字数 165 浏览 2 评论 0原文

我已经安装了“la Clojure”和“leiningen”插件。我创建了一个 clojure 项目并将 lib/ 文件夹添加为我的项目中的库。完成此操作后,编辑器了解这些库,如果我“运行”clojure 文件,它会成功加载依赖项,但如果我在 intellij 中启动控制台,它不会加载依赖项。如何让控制台加载它们?

I've installed the "la Clojure" and "leiningen" plugins. I've created a clojure project and added the lib/ folder as a library in my project. With this done the editor knows about the libraries and if I 'run' a clojure file it successfully loads the dependencies, but if I start a console within intellij it doesn't load the dependencies. How do I get the console to load them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

丑丑阿 2024-12-03 11:11:45

我打开项目设置,添加 lib 和 lib/dev 作为 JAR 目录(IntelliJ 扫描它们以查找更改并自动更新类路径)。这适用于 Clojure 控制台。

I open the project settings, add lib and lib/dev as JAR directories (IntelliJ scans them for changes and updates the classpath automatically). This works with the Clojure console.

晚雾 2024-12-03 11:11:45

我会生成它,并让 idea 使用 Maven 来跟踪依赖项

lein pom

如果 pom.xml 尚不存在,

I use

lein pom

to generate pom.xml if it does not already exists and let idea to use maven to track the dependencies

左岸枫 2024-12-03 11:11:45

我创建了一个 clojure 文件,它需要我的所有源文件。然后从 repl 屏幕我(加载“start-repl.clj”)。由于手动步骤,这不是一个很好的解决方案,但它让我黑客攻击......

I created a clojure file that requires all of my source files. then from the repl screen I (load "start-repl.clj"). It's not a really good solution because of the manual steps but it gets me hacking...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文