"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Javac vs. Eclipse Compiler: What are the Key Differences?

Javac vs. Eclipse Compiler: What are the Key Differences?

Posted on 2025-03-25
Browse:152

Javac vs. Eclipse Compiler: What are the Key Differences?

Javac vs Eclipse Compiler: What's the Distinction?

Unlike javac, which ships with the Sun JDK, Eclipse employs a distinct Java compiler titled Eclipse Compiler for Java (ECJ). This differentiation extends beyond mere aesthetics.

One glaring divergence between these compilers lies in their handling of compilation errors. While javac halts compilation entirely in the presence of errors, ECJ allows for code execution without raising immediate errors. However, should the problematic code execute, it triggers an exception, flagging the improper compilation attempt.

Another notable distinction revolves around incremental builds. ECJ seamlessly conducts these within the Eclipse IDE, compiling code immediately after typing.

Evidencing its independence, Eclipse's compiler empowers users to write, compile, and execute Java code without the Java SDK's presence.

In certain scenarios, preference might lean towards ECJ over javac. Apache Tomcat's utilization of ECJ forJSP compilation serves as an example. IntelliJ IDEA,GNU Compiler for Java (GCJ), and Liferay all integrate with ECJ for their respective compilation needs.

Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3