且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

javac和Eclipse编译器有什么区别?

更新时间:2023-12-04 14:54:20

Eclipse已经实现了自己的编译器,命名为 Eclipse编译器for Java (ECJ)。

Eclipse has implemented its own compiler called as Eclipse Compiler for Java (ECJ).

它不同于javac,Sun JDK附带的编译器。一个显着的区别是,Eclipse编译器允许您运行实际上没有正确编译的代码。如果错误的代码块从未运行,您的程序将运行良好。

It is different from the javac, the compiler that is shipped with Sun JDK. One notable difference is that the Eclipse compiler lets you run code that didn't actually properly compile. If the block of code with the error is never ran, your program will run fine. Otherwise, it will throw an exception indicating that you tried to run code that doesn't compile.

另一个不同之处在于Eclipse编译器允许在Eclipse中进行增量构建IDE,也就是所有的代码一旦你完成输入就编译。

Another difference is that the Eclipse compiler allows for incremental builds from within the Eclipse IDE, that is, all code is compiled as soon as you finish typing.

Eclipse自带的编译器也是很明显的,因为你可以编写,并且在Eclipse中运行Java代码,甚至不安装Java SDK。

The fact that Eclipse comes with its own compiler is also apparent because you can write, compile, and run Java code in Eclipse without even installing the Java SDK.

ECJ比javac更受欢迎的一些例子是:

A few examples where ECJ is preferred over javac is:


  • Apache Tomcat 使用ECJ编译JSP,

  • IntelliJ IDEA 支持ECJ,从 GNU Compiler for Java (GCJ)4.3,

  • GCJ与ECJ集成,

  • Liferay使用ECJ构建。

  • Apache Tomcat uses ECJ to compile JSPs,
  • IntelliJ IDEA has support for ECJ, as of GNU Compiler for Java (GCJ) 4.3,
  • GCJ integrates with ECJ,
  • Liferay builds with ECJ.