Java compiler
From Wikipedia, the free encyclopedia
In computing, a Java compiler is a computer program that translates programs in the Java programming language source code to Java class files.
As of 2006, the following are major Java compilers:
- Javac, included in JDK from Sun Microsystems.
- Jikes, an open source compiler from IBM, which is written in C++ and uses a variant of static single assignment form for optimization.
- GCJ, a part of gcc which compiles C, Fortran, Pascal and other programming languages besides Java. It can also generate native code using the back-end of gcc.
- ECJ, the Eclipse Compiler for Java, is an open source incremental compiler used by the Eclipse JDT.
The compiler compiles the Java source code to a Java class file that contains the generated Java bytecode. The Java Virtual Machine (JVM) loads the class file and either interprets the bytecode or just-in-time compiles it to machine code and then possibly optimizes it using dynamic compilation. Most Java compilers, Jikes being the only exception, do virtually no optimization, leaving this until runtime to be done by the JRE. Even though each compiler uses a different technique, they all generate the same class file format.
The very first Java compiler developed by Sun Microsystems was written in C using some libraries from C++.[citation needed]
[edit] External links
- Jikes homepage
- JSR 199 Java Compiler API Java Specification Request for invoking the Java compiler from a Java program
- Java Sun