在 Leiningen 项目中通过 Emacs 使用 Java
关于 SO 有很多密切相关的问题,仅举其中一些:
我的问题的不同之处在于,我想知道如何在混合 Clojure/Java Leiningen 项目中直接从 Emacs 使使用 Java 与使用 Clojure 一样简单。
我的意思是可以(按优先级顺序):
- lein javac 从 shell 编译它)
- 直接从 Emacs 编译 Java 代码(注意:可以使用 Java 的代码完成(JDEE 等工具提供此功能,但它是独立的不关心的工具Leiningen 项目设置)
- 调试 Java 代码
There's plenty of closely related questions on SO, just to name some of them:
- Java and Clojure with Leiningen
- What is the best way to do Java development in Emacs?
- Best java tools for emacs
The difference of my questions is that I want to know how to make working with Java as easy as with Clojure right from Emacs within mixed Clojure/Java Leiningen project.
What I mean is possibility to (in order of priority):
- compile Java code right from Emacs (note: it is possible to compile it from the shell with
lein javac
) - use code completion for Java (tools like JDEE provide this feature, but it is separate tool that doesn't concern Leiningen project setup)
- debug Java code
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查看 Emacs LSP 项目。它提供对 Java 的支持。
Check out the Emacs LSP project. It provides support for Java.
我想尝试自动完成,但我还没有做到。
考虑到 leiningen/Clojure 的工作方式,我不确定编译有多容易。当你编译Java代码时,你是否必须重新启动repl/应用程序才能让JVM重新加载它?
I want to try auto complete but I haven't gotten to it yet.
Given the way leiningen/Clojure work anyway, I'm not sure how easy you could make compilation. When you compile Java code, don't you have to restart the repl/application for the JVM to reload it anyway?
Malabar-mode 是废弃软件,但我认为它正在达到您想要的功能级别。在我看来,基于协进程的自动完成引擎应该可以通过 CEDET、leiningen 和 swank-clojure 实现,但我有一份日常工作和副业......
Malabar-mode is abandonware but I think it's shooting for the level of functionality that you want. It seems to me that a coprocess-based autocompletion engine should be feasible with CEDET, leiningen, and swank-clojure, but I have a day job and side work...
可能不是您想要的,但这应该可以为您处理第 1 点:
Probably not what you wanted exactly, but this should handle bullet 1 for ya: