简体   繁体   English

Emacs java-mode:malabar,jdee还是eclim?

[英]Emacs java-mode: malabar, jdee, or eclim?

I want to use emacs for java coding, but I'm confused on what mode to use for java coding. 我想使用emacs进行java编码,但我对用于java编码的模式感到困惑。 There's jdee, which seems ide-like; 有jdee,看起来像ide; malabar, who is said to be more well versed in java 1.5 constructs than jdee; malabar,据说比jdee更精通java 1.5构造; and emacs-eclim, which is an eclipse backend for emacs. 和emacs-eclim,这是emacs的eclipse后端。 There are also a wealth of completion extensions for emacs, and I'm also confused on which one to use. emacs还有大量的完成扩展,我也对使用哪一个感到困惑。 In fact, I'm so confused that I deferred using any of them until I get recommendations. 事实上,我很困惑,我推迟使用其中任何一个,直到我得到建议。

What is the current best option for java-mode + completion in emacs? 在emacs中,当前最好的java模式+完成选项是什么? And, if ever I decide to use a combination of what I mentioned above, will conflicts happen? 而且,如果我决定使用上面提到的组合,会发生冲突吗?

For those used to the power of Emacs text manipulation then Eclipse can seem like pedaling a bicycle with one foot. 对于那些习惯于使用Emacs文本操作功能的人来说,Eclipse看起来就像是用一只脚踩踏自行车。 The Emacs+ plugin from http://www.mulgasoft.com/ is excellent for getting Emacs key bindings into Eclipse. 来自http://www.mulgasoft.com/的Emacs +插件非常适合将Emacs键绑定到Eclipse中。

I use both Eclipse and Emacs a lot, but if I only did Java development I might use only Eclipse with Emacs+. 我经常使用Eclipse和Emacs,但如果我只进行Java开发,我可能只使用Eclipse和Emacs +。 It takes some work to get many Eclipse features enabled on Emacs. 在Emacs上启用许多Eclipse功能需要一些工作。

My advice is to use Emacs >= 23. If you are on a Mac, look at AquaMacs . 我的建议是使用Emacs> = 23.如果你在Mac上,请查看AquaMacs I use JDEE as the Java plugin. 我使用JDEE作为Java插件。 This has the serious drawback of not playing well with generics. 这具有不能很好地使用泛型的严重缺点。 It's not that it stops working, it's just that a lot of stuff isn't recognized. 并不是它停止工作,只是很多东西都没有被识别出来。 Do not use the old 2.3.5 JDEE plugin (that comes with most Linux distributions), but get the 2.4 version from the sourceforge site. 不要使用旧的2.3.5 JDEE插件(大多数Linux发行版附带),但从sourceforge站点获取2.4版本。 Also get the Emacs Code Browser (ECB); 还可以获得Emacs代码浏览器 (ECB); this is a plugin that will give you stuff like Eclipse's Project Explorer and Outline views (other developers will look at this and not believe you when tell them that it's Emacs). 这是一个插件,可以为你提供Eclipse的Project Explorer和Outline视图(其他开发人员会看到这个并且在告诉他们它是Emacs时不相信你)。 I've used this setup for commercial projects on Windows, Mac, and Linux in the past year. 在过去的一年里,我已经将这个设置用于Windows,Mac和Linux上的商业项目。

In fact, Eclipse plays pretty well with Emacs and I often switch between the two. 事实上,Eclipse与Emacs相处得非常好,我经常在两者之间切换。 Eclipse has some nice refactoring tools that I used to use sed for, and it has a good debugger interface. Eclipse有一些很好的重构工具,我以前使用sed,它有一个很好的调试器接口。 You can use them simultaneously. 您可以同时使用它们。 I find that I use Eclipse when working with other people's code and Emacs when I am writing my own code---Emacs is that much faster. 当我编写自己的代码时,我发现在使用其他人的代码和Emacs时使用Eclipse --- Emacs要快得多。 Note that for me, a lot of the value of Emacs is the non-Java functionality, like editing Tomcat configuration files on remote servers from my local Emacs, writing professional documents with LaTeX, developing in Python or Bash or MATLAB or XML, and the odd text manipulation task (eg, converting CVS files into String[] arrays). 请注意,对我来说,Emacs的很多价值都是非Java功能,比如从我的本地Emacs编辑远程服务器上的Tomcat配置文件,用LaTeX编写专业文档,用Python或Bash或MATLAB或XML开发,以及奇数文本操作任务(例如,将CVS文件转换为String []数组)。

I haven't used the other two projects you mention. 我没有使用你提到的其他两个项目。 It is possible to use the Eclipse compiler with Emacs already, so I'm not sure I see the point of the emacs-eclim project, which seems to be moribund anyway. 可以将Eclipse编译器与Emacs一起使用,所以我不确定我是否看到了emacs-eclim项目的重点,无论如何这似乎都是奄奄一息。 The Malabar project might be interesting, but seems to be the product of one somewhat cranky developer (eg, the warning "if you're not using Maven (why?) you should not consider malabar-mode"---I'll tell my clients that?). 马拉巴尔项目可能很有趣,但似乎是一个有点胡思乱想的开发人员的产物(例如, 警告 “如果你不使用Maven(为什么?)你不应该考虑malabar模式” - 我会告诉我的客户那?)。

Java on Emacs is in a sad state. Emacs上的Java处于悲伤状态。 I wish for JDEE to be revitalized, but it's not clear when or if that will happen. 我希望JDEE能够重新焕发活力,但目前还不清楚何时或是否会发生这种情况。 The web site and mailing list offer few clues. 网站和邮件列表提供的线索很少。

I use emacs-eclim with auto-complete-mode support and java-mode highlighting exclusively for Java programming. 我使用emacs-eclim和自动完成模式支持以及专门用于Java编程的java模式突出显示。 90% of my work is done in emacs, but I switch to eclipse when I need to debug, run unit tests or do major refactorings. 我的90%的工作都是在emacs中完成的,但是当我需要调试,运行单元测试或进行重大重构时,我会切换到eclipse。 All in all, this setup works very well for me. 总而言之,这个设置对我来说非常有用。

I haven't tried JDEE for years, but I remember it was ab*tch to set up. 我多年没有尝试过JDEE,但我记得设置它是非常好的。 I didn't care for the UI very much, as it put up lots of prearranged windows that were locked in place. 我不太关心用户界面,因为它放置了许多被锁定到位的预先安排的窗口。 I like to be able to switch back and forth between editing buffers, often showing just one window, but splitting and rearranging on the fly when it becomes necessary. 我喜欢能够在编辑缓冲区之间来回切换,通常只显示一个窗口,但在必要时动态分割和重新排列。

Note: I am an emacs-eclim maintainer, and this has probably coloured my judgement. 注意:我是一名emacs-eclim维护者,这可能使我的判断更加突出。

If you're using Maven, then I'd recommend malabar-mode. 如果您正在使用Maven,那么我建议使用malabar-mode。 It will set everything up for you automagically, no need for editing project files like you'd have to do with JDEE. 它将自动为您设置所有内容,无需编辑项目文件,就像您必须使用JDEE一样。 The downside I've found with malabar, is that it can consume a lot of memory if you've got a lot of multi level module projects open. 我在malabar中发现的缺点是,如果你打开了很多多级模块项目,它会占用大量内存。

Both Malabar and JDEE will give you "true" completion, ie only completions that are possible. 马拉巴尔和JDEE都会给你“真正的”完成,即只有可能的完成。 However, there are two amazing "intelligent guessing completion frameworks" in Emacs. 但是,Emacs中有两个令人惊叹的“智能猜测完成框架”。 hippie-expand and auto-complete. 嬉皮 - 扩展和自动完成。

The former is great (can complete whole code blocks for you, making it possible to eg cycle through all if-tests in your projects), but auto-complete mode is even better. 前者很棒(可以为您完成整个代码块,使得可以循环遍历项目中的所有if-tests),但自动完成模式甚至更好。 It'll give you a nice intelli sense style menu, will "learn" as you use it, and allows you to define a file with the completions you'd like to be available in the various languages. 它会为您提供一个很好的智能风格菜单,在您使用它时会“学习”,并允许您定义一个文件,其中包含您希望以各种语言提供的完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM