如何为Eclipse IDE设置其他eclipse Java编译器 [英] How to set up other-than-eclipse Java compiler for Eclipse IDE

查看:226
本文介绍了如何为Eclipse IDE设置其他eclipse Java编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,Eclipse IDE(对于Java,3.5.1版)使用自己的java编译器,但是我找不到如何更改它。甚至有可能吗?



也许这很简单,但是经过多年使用IntelliJ IDEA,我发现回到Eclipse有点尴尬。



谢谢。



更新:由于要求更详细的解释,我在做。



所以,最近我正在帮助一些Java开发人员,并注意到他正在使用Sun的JDK。从全公司以来,我们只使用Sun的JDK,我觉得很奇怪。



似乎他只有Eclipse,并且不需要用于编译java代码的其他工具(如javac)。这是因为Eclipse与其自己的编译器捆绑在一起(请参阅这个有更多的细节)。



本身我发现这个功能非常好,我相信有很好的理由。但我希望我们所有的公司开发人员使用相同的编译器来生成java字节码(.class文件)。并在同一个JVM中运行它。只是为了尽可能统一的环境,并消除额外的环境问题。我在Eclipse中指定JRE没有问题。



但是我没有找到如何将默认的Java编译器更改为javac。另一方面,我的主IDE IDE IntelliJ IDEA允许这样做(在javac,jikes或eclipse编译器之间选择)。所以我只是想知道Eclipse是否可以相同。



另外:




  • 不,我没有真正的Eclipse编译器的问题,所以这只是可以选择的问题。

  • 我知道Apache Ant和其他解决方案可以用于用任何编译器编译Java代码。但是在这里,我对Eclipse及其集成项目构建感兴趣(例如项目菜单下的菜单项)。


解决方案

你想要什么?如果您想要使用Sun编译器创建的类,可以使用Ant构建它们。 Eclipse使用自己的编译器,因为Sun的编译器不是设计为在自动编译环境中使用。



JDT网站


增量Java编译器。实现为Eclipse构建器,它基于从VisualAge for Java编译器演化的技术。特别是,它允许运行和调试仍然包含未解决的错误的代码。


请记住,对于库本身,Eclipse将仍然使用Sun的编译器,可以使用另一个答案(NimChimpsky和The Elite)解释的过程进行设置。


I noticed that Eclipse IDE (for Java, version 3.5.1) uses it's own java compiler(s), but I can't find how to change it. Is it even possible?

Maybe it's kinda trivial, but after many years of using IntelliJ IDEA I find returning to Eclipse a little bit awkward.

Thanks.

UPDATE: Since more detailed explanation was requested, I'm doing that.

So, recently I was helping out some fellow Java developer and noticed he is using Eclipse w/o Sun's JDK. Since company-wide we are using only Sun's JDKs, I found it rather strange.

It appeared that he has only Eclipse and no additional tools for compiling java code (like javac) are required. This is because Eclipse comes bundled with its own compiler (check this for more details).

By itself I find this feature quite nice, and I believe there were good reasons for that. But I would like all our company developers to use same compiler to generate java bytecode (.class files). And to run this in same JVMs. Just for sake of having as unified environment as possible and eliminating additional environment-specific issues. I have no problem with specifying JRE in Eclipse.

But I failed to find how to change default Java compiler to javac. On the other hand, my primary IDE IntelliJ IDEA allows do that (choose between javac, jikes or eclipse compilers). So I just wanted to know if same is possible in Eclipse or not.

Additionally:

  • No, I have no real problems with Eclipse compiler as such, this is simply matter of being able to choose.
  • I know that Apache Ant and other solutions can be used to compile Java code with any compiler. But here I'm interested in Eclipse and its integrated project building (e.g. menu items under Project menu).

解决方案

What do you want to have? If you want to have the classes created by Sun compiler, you can build them using Ant. Eclipse uses its own compiler because Sun's compiler is not designed to be used in auto-compiled environment.

From the JDT website:

An incremental Java compiler. Implemented as an Eclipse builder, it is based on technology evolved from VisualAge for Java compiler. In particular, it allows to run and debug code which still contains unresolved errors.

Keep in mind that for the library itself, Eclipse will still use the one from Sun's compiler that can be set using the procedure explained by another answers (NimChimpsky and The Elite).

这篇关于如何为Eclipse IDE设置其他eclipse Java编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆