javac和Eclipse编译器有什么区别? [英] What is the difference between javac and the Eclipse compiler?
问题描述
javac
程序的相同核心的包装器,还是一个单独的编译器? Eclipse已经实现了自己的编译器,称为 Eclipse Java编译器(ECJ)。
它与javac(Sun JDK附带的编译器)不同。一个显着的区别是,Eclipse编译器允许您运行实际不正确编译的代码。如果有错误的代码块永远不会运行,你的程序将运行正常。否则,它将抛出一个异常,表示您尝试运行不编译的代码。
另一个区别是Eclipse编译器允许从Eclipse内部进行增量版本IDE,也就是说,一旦你完成输入,所有代码就被编译。
Eclipse自带编译器的事实也很明显,因为你可以编写,并且在Eclipse中运行Java代码,甚至不用安装Java SDK。
ECJ优于javac的几个示例是:
- Apache Tomcat 使用ECJ编译JSP, li>
- IntelliJ IDEA 支持ECJ,截至 GNU GNU Compiler for Java (GCJ)4.3,
- GCJ与ECJ集成,
- Liferay构建wi ECJ。
Is Eclipse's Java compiler just a wrapper around the same core that the javac
program is wrapped around, or is it a separate compiler altogether? If the latter, why would they reinvent the wheel?
Eclipse has implemented its own compiler called as Eclipse Compiler for Java (ECJ).
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.
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.
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.
A few examples where ECJ is preferred over javac is:
- 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.
这篇关于javac和Eclipse编译器有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!