program compiler for Java programming language
Eclipse has its own Java compiler, which is called [JDT Core][1] (org.eclipse.jdt.core). The compiler itself is included in the org.eclipse.jdt.core plugin. Eclipse won't use any user installed JDK. Instead it uses its own JDT core to compile Java program due to the following primary reason:
The primary reason is that JDT core has the ability of incremental compilation, which means that it incrementally compiles changes in your code (this is also why Eclipse does not need a compilation button because it automatically compiles when changes are detected). But Oracle's JDK does not support incremental compilation.
Does Eclipse's JDT core compiler include a JRE?
- No. JDT core is different from JDK. JDT core is a compiler not including a JRE (while JDK includes JRE). This is why we must specify installed JREs for Eclipse to start.
In summary, Eclipse uses its own JDT core as the Java compiler. The JDT core compiler does not have a JRE. So Eclipse requires user installed JRE to run the .class code.
References:
[1] JDT Plug-in Developer Guide, http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Fguide%2Fjdt_api_compile.htm
[2] JDT Core Component, https://www.eclipse.org/jdt/core/
[3] How does Eclipse compile classes with only a JRE? How does Eclipse compile classes with only a JRE?
In contrast to other Java IDEs, Eclipse uses its own incremental compiler written in Java. It can display more warnings and errors than javac. Both, the Eclipse compiler and javac implement the Java Language Specification. There are corner cases where the two compilers produce different bytecode or one of them fails (e. g. see this Stack Overflow question).
The Eclipse compiler requires at least a JRE for the class files, e. g. java/lang/String.class. A JDK is only to see the source code, but not required by the Eclipse compiler.
So far Eclipse was not shipped with a JRE (see Eclipse bug 506244). But this could change soon after the Java virtual machine OpenJ9 became an Eclipse project.
How javac creates an executable of himself?