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:
it is a separate compiler altogether. this is needed as javac doesn't allow compilation of slightly broken code, from the eclipse site
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.
eclipse's built-in compiler is based on ibm's jikes java compiler. (note that eclipse also started its life at ibm). it is completely independent of sun's java compiler in the jdk; it is not a wrapper around sun's
jikes has existed for a long time, it used to be a lot faster than the standard jdk java compiler (but i don't know if that's still true). as to why ibm wanted to write their own java compiler: maybe because of licensing reasons (they also have their own java implementation).
everyone has already explained that they're different. here are some difference in behaviors i've noticed between the two compilers. they all boil down to a bug in (at least) one of the implementations.
compile-time optimization related
generics type inferrence related
- What is the difference between javac and the Eclipse compiler?
- What is the difference between the Eclipse Package Explorer and the Eclipse Project Explorer?
- What is the difference between Eclipse for Java (EE) Developers and Eclipse Classic?
- What is the difference between Eclipse 3.7 and Eclipse 4.1?
- What is the difference between rollback, backout and strip in the Mercurial Eclipse plugin?
- What is the difference between Eclipse with Spring IDE plugin and Spring Tool Suite alone?
- What the difference between Eclipse 3.7, 3.8 and 4.2?
- What is the difference between Eclipse and Netbeans if I want to use only the Java in it?
- What is the difference between Eclipse "Import" and "Create project from existing source" for Android projects?
- What is the difference between Eclipse and Myeclipse
- What is the difference between "Java Build Path" and "Deployment assembly" in Eclipse dynamic web project IDE?
- What is the difference between "Project References" and "Paths and Symbols -> References" in Eclipse CDT?
- What is the difference between building a WSDL in Eclipse and using WCF?
- what is the difference between refresh and update project in eclipse
- What is the difference between console and eclipse maven
- Eclipse Cpp - What is the difference between C Project, C/C++ Project and C++ Project?
- What is the difference between application context and workbench context in eclipse e4?
- What is the difference between Eclipse IDE for Java EE Developer and Eclipse for Mobile Developer?
- what is the difference between maven-archetype-webapp and eclipse dynamic web project
- What is the difference between local and remote SonarQube Eclipse Plugin analysis?
- What is the difference between Eclipse RCP and EMF Client Platform (ECP)?
- Eclipse - What is the difference between "ArcGIS Runtime SDK for Android" and "ArcGIS for Android Apps"?
- What is the difference between tomcat running inside eclipse and tomcat running on a server?
- What is the difference between bendpoints in JBPM 3 plugin for Eclipse and JPBM 4 plugin for Eclipse?
- What is the difference between Ctrl Alt H and f4 in eclipse
- What is the difference between Eclipse for Java and RCP?
- What is the difference between "Select Active Profiles" and "Run Configuration: profiles" in Eclipse with m2e?
- What is the difference between regular quit and eclipse terminate?
- what is the Difference between single class diagram and one class diagram per package during diagram creation in eclipse modeling juno
- What is the difference between between toggle breakpoint and disable breakpoint in Eclipse IDE?
More Query from same tag
- configure() not be called when running on hadoop cluster but can be called on Eclipse, DistributedCache FIleNotFoundException
- Eclipe LUNA - "The import java.sql cannot be resolved"
- Java class diagrams for Eclipse? (Galileo 3.52)
- Error occurs while installing Groovy IDE in Eclipse
- Eclipse Kepler: #include "boost/filesystem.hpp" breaking debugging?
- Mozilla internal web browser unavailable on Eclipse
- findFragmentById for SupportMapFragment returns null in Android Studio
- having trouble with inserting data into mysqlite database
- Why do I need Maven if I use Eclipse?
- Can't see errors/warnings in Problems view unless project is selected in Package Explorer
- M2E is not for big project?
- GWT: getting java.lang.NoClassDefFoundError on server side
- Eclipse JDT - How to watch non-public variables?
- Didn't find class “com.google.firebase.provider.FirebaseInitProvider, While upgrading the apk from eclipse with studio build
- gwt - error in web mode when calling to async function
- How to use word-wrap feature in Eclipse?
- Eclipse Debugging- out of sync Issue
- Where do you put server.xml in a tomcat eclipse project when checking into version control?
- How can I write to the setup file from Navigate - Open Setup?
- My app won't show up on android emulator and android device
- NoClassDefFoundError While using Eclipse Cloud Foundry Plugin
- Autocompletion and automatically adding imports in FXML?
- How to fix java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) error
- String Tokenizer - To grab ques and answer by tag
- Debug Python Curses app in Eclipse PyDev?
- How to put GLSurfaceView inside a layout on android
- Big error about data type not supported in JAX-RPC specification using Eclipse
- Unrecognized vm option when opening eclipse
- How do I stop Eclipse (STS) from creating a new runtime configuration every time I start a server
- Using Apache Velocity with Spring Framework 3.2.4