使用 emacs 进行 java 编程

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11912477/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 06:53:51  来源:igfitidea点击:

using emacs for java programming

javaemacs

提问by pranavsharma

Has anyone had any success in configuring emacs for Java development? I installed cedet and malabar mode but couldn't get to use it successfully. Is it even worth spending more time setting up emacs or should I switch to Eclipse? I'm a long time Emacs user. Thanks a lot.

有没有人在为 Java 开发配置 emacs 方面取得过任何成功?我安装了 cedet 和 malabar 模式,但无法成功使用它。是否值得花更多时间设置 emacs 或者我应该切换到 Eclipse?我是 Emacs 的长期用户。非常感谢。

回答by Tom

You can try eclimwhich has an Emacs interface. It uses Eclipse as a backend to provide intelligent Java completion features for Emacs. This way you can have the power of Eclipse in Emacs without having to completely to switch to it.

您可以尝试具有 Emacs 界面的eclim。它使用 Eclipse 作为后端为 Emacs 提供智能的 Java 完成功能。这样您就可以在 Emacs 中使用 Eclipse 的强大功能,而无需完全切换到它。

回答by Rajesh J Advani

I've been using the Java Development Environment for Emacs for a decade now. You can get it at http://jdee.sourceforge.net/

我已经使用 Emacs 的 Java 开发环境十年了。你可以在http://jdee.sourceforge.net/得到它

It was last updated in 2010, and it's definitely not as powerful as Eclipse, but if you're addicted to Emacs, it provides a lot of great features, including creation of code from templates.

它最后一次更新是在 2010 年,它绝对没有 Eclipse 强大,但是如果您对 Emacs 上瘾,它提供了许多很棒的功能,包括从模板创建代码。

The dependencies are also available for download from the same SourceForge site.

依赖项也可以从同一个 SourceForge 站点下载。

回答by Rajesh J Advani

Eclipse is, actually, the only IDE that I know that can be configured to use Emacs-like navigation and typing. But this support is horrible! Eclipse lacks a lot of Emacs features, so it's not even the matter of proper mapping - a lot of things aren't implement (or, perhaps, impossible to implement). Also, this support is often untested and overlaps with accessibility hotkeys, i.e. whenever you'd try to use M-g gyou might instead activate some button in the GUI that has access key g, and the next access key g, again, something like Alt+ DebugConfiguration >> Configure. Worst yet this is unpredictable, because the access keys might change according to layout.

实际上,Eclipse 是我所知道的唯一可以配置为使用类似 Emacs 的导航和输入的 IDE。但是这种支持太可怕了!Eclipse 缺少很多 Emacs 特性,所以这甚至不是正确映射的问题——很多东西没有实现(或者,也许,不可能实现)。而且,这种支持往往是未经测试,并与辅助功能热键,即重叠每当你尝试使用M-g g你可能反而再次激活在具有访问键克GUI一些按钮,接下来的访问密钥克,又像是Alt+得不g ^配置>> CONFIURE。最糟糕的是,这是不可预测的,因为访问键可能会根据布局而改变。

OK, I invented the example above, but this is because the real life cases are more involved. They do exist, however. Besides, in Eclipse, you must use mouse fairly often. For example, switching between windows inside of it is not possible without it. Actually, you cannot even create a file w/o using mouse.

好吧,我发明了上面的例子,但这是因为现实生活中的案例更多。然而,它们确实存在。此外,在 Eclipse 中,您必须经常使用鼠标。例如,没有它就不可能在其内部的窗口之间切换。实际上,您甚至无法使用鼠标创建文件。

I tried JDEE some time ago, but, so far I could understand, the project isn't actively worked on any more. However, Debian provides jde package, and it loads and seems to work, it comes as elc files (no sources). I wanted to use newer CEDET (which comes with newer eioei), but they wouldn't work together. I also had problems either configuring or using the debugger - as far as I remember it kept disconnecting, perhaps, not being able to work with newer JRE. I haven't investigate it much further, but I used certain things pretty often, such as Maven and Ant builds - those, however they seem a bit archaic, worked well, can't remember any problem with that.

前段时间我尝试过 JDEE,但是,到目前为止我能理解,该项目不再积极开展工作。但是,Debian 提供了 jde 包,它加载并且似乎可以工作,它是作为 elc 文件(无源)提供的。我想使用较新的 CEDET(带有较新的 eioei),但它们不能一起工作。我在配置或使用调试器时也遇到了问题——据我所知,它一直断开连接,也许无法使用较新的 JRE。我没有进一步研究它,但我经常使用某些东西,例如 Maven 和 Ant 构建——这些,但是它们看起来有点过时,运行良好,不记得有任何问题。

I believe that if there's anyone patching JDEE, those would be the same people who work on CEDET. So, it might make sense to ask on their mailing list about the status of the project, perhaps they know more.

我相信,如果有人修补 JDEE,那将是那些在 CEDET 上工作的人。因此,在他们的邮件列表中询问项目状态可能是有意义的,也许他们知道更多。

回答by Nullpointer

Ok. This is a very old question but I would like to add answer to it.

行。这是一个非常古老的问题,但我想添加答案。

For all those who want to use emacs keybindings but need a good IDE for java development use Intellij. I recently moved to Intellij from eclipse and Intellij is way better than eclipse. It has default emacs key bindings which work exactly like emacs. You can use it in the console and other places as well! Give it a try.

对于所有想要使用 emacs 键绑定但需要一个好的 IDE 进行 java 开发的人,请使用Intellij。我最近从 eclipse 转移到 Intellij,Intellij 比 eclipse 好得多。它具有默认的 emacs 键绑定,其工作方式与 emacs 完全相同。您也可以在控制台和其他地方使用它!试一试。

The best choice for java development with emacs keybindings is certainly Intellij

使用 emacs 键绑定进行 java 开发的最佳选择当然是 Intellij