Java compiler: Difference between revisions

Content deleted Content added
m fix date
Some reorganization and rewording
Line 1:
In [[computing]], a '''Java compiler''' is a [[computer programcompiler]] that translates programs infor the [[Java (programming language)|Java programming language]]. [[source code]]The most common form of output from a Java compiler tois [[Class (file format)|Java class files]].
 
Most Java compilers, [[Jikes]] being thea onlywell known exception, do virtually no [[Optimization (computer science)|optimization]], leaving this until [[runtime]] to be done by the [[JRE]]{{Fact|date=April 2007}}.
 
Using this generated [[Java bytecode]], theThe [[Java Virtual Machine]] (JVM) loads the class files and either [[interpreter (computing)|interprets]] the [[bytecode]] or [[just-in-time compilation|just-in-time]] compiles it to [[machine code]] and then possibly optimizes it using [[dynamic compilation]].
 
== Major Java compilers ==
[[As of 2006]], the following are major Java [[compiler]]s:
* [[Javac|javac]], included in [[Java Development Kit|JDK]] from [[Sun Microsystems]], open-sourced since the [[13 November]] [[2006]].
* [[GCJ]], a part of [[GNU Compiler Collection|gcc]] which compiles [[C (programming language)|C]], [[Fortran]], [[Pascal programming language|Pascal]] and other [[programming language]]s 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 (software)|Eclipse]] JDT.
* [[Jikes]], an [[open source]] compiler from [[IBM]], which is written in [[C++]] and uses a variant of [[static single assignment form]] for optimization. As of early 2007 the project is no longer being actively developed <ref>The last 1.22 version is of [[October]] [[2004]] [http://sourceforge.net/project/showfiles.php?group_id=128803]. The project CVS activity for the last 12 months is null [http://sourceforge.net/project/stats/detail.php?group_id=128803&ugn=jikes&type=cvs&mode=12months]</ref>.
 
The compiler compiles the Java source code to a Java class file that contains the generated [[Java bytecode]]. Even though each compiler uses a different technique, they all generate the same class file format.
 
Most Java compilers, Jikes being the only exception, do virtually no [[Optimization (computer science)|optimization]], leaving this until [[runtime]] to be done by the [[JRE]]{{Fact|date=April 2007}}.
 
Using this generated [[Java bytecode]], the [[Java Virtual Machine]] (JVM) loads the class files and either [[interpreter (computing)|interprets]] the [[bytecode]] or [[just-in-time compilation|just-in-time]] compiles it to [[machine code]] and then possibly optimizes it using [[dynamic compilation]].
 
The very first Java compiler developed by Sun Microsystems was written in C using some libraries from C++.{{Fact|date=February 2007}}