Main page > Java > Compilers

List of Java bytecode compilers

Bytecode compilers translate Java source code files (typical file extension: .java) to class files (.class) containing bytecode. This bytecode is interpreted by a Java virtual machine (JVM) at runtime. Modern JVMs translate bytecode to machine code at runtime to make execution faster. The best-known bytecode compiler is probably javac which comes with every Java Development Kit (JDK).

The other approach to compilation are native compilers. They translate source code directly into executable code made for a particular platform (e.g. the Intel x86 architecture). There is a dedicated page for native Java compilers.

If you know about bytecode compilers not listed here, please send me a mail. Please read these remarks first.

abc: AspectBench compiler for AspectJ

http://abc.comlab.ox.ac.uk/introduction

AspectJ is an extension of the Java programming language. abc is a compiler for that extension. The software is part of a research project and distributed under the LGPL.

Eclipse

http://www.eclipse.org/

Eclipse is a free IDE which comes with a built-in compiler of its own.

Espresso

http://types.bu.edu/Espresso/JavaEspresso.html

A Java 1.0 compliant source code to bytecode compiler. Includes source code of the compiler, javadoc documentation, a report and slides.

gcj

http://gcc.gnu.org/java/

A GNU compiler that can create bytecode, but can also create native machine code from source code or bytecode. It seems that parts of the runtime environment are still missing, also there is no information on which version of Java this is compatible to. A related project, Classpath, creates a version of the standard Java class library that does not rely on Sun's code.

GJ

http://www.research.avayalabs.com/user/wadler/gj/

GJ is an extension of the Java programming language to support generic types. This is the compiler for that language extension.

JANINO

http://www.janino.net/

An embedded compiler that converts Java expressions, blocks or source code files to bytecode. To be used for runtime compilation, e.g. with expression evaluators or server page engines. Distributed under the LGPL.

javac

http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javac.html

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/javac.html

The javac source code to bytecode compiler is part of every Java Development Kit. It is in fact itself a Java program that is usually stored in tools.jar in the lib subdirectory of your JDK. As it is part of the sun.* package hierarchy (sun.tools.javac.Main) there is neither support nor documentation for it. Being a Java program makes it possible to compile Java code even on platforms where there is "only" a virtual machine (like Psion) or from within your own Java program. On the other hand, the startup time is relatively long so that you might want to consider alternatives like jikes if you start the compilation process often.

Jikes

http://jikes.sourceforge.net/

Jikes is a a Java source code to bytecode compiler. Being written in C++, it starts and compiles faster than javac. Its error messages are sometimes more helpful than those of javac, it suggests alternatives when identifiers were misspelled, offers several types of output (e. g. an Emacs mode) and more. Its source code is available, binaries for Linux (x86 and PowerPC), Win32 and AIX are distributed on the homepage.

IBM released the first version of jikes in 1997. As of 2007, IBM employees no longer officially maintain the jikes project. It has become an open source project hosted at SourceForge. As of February 2007, the last release dates back to October 2004.

IBM has an overview of Jikes ports as well.

The MacOS version has its own homepage: MacJikes. It seems like that page was last modified in 2000.

There also is Jikes for QNX.

The JUMP Compiler

http://ourworld.compuserve.com/homepages/DeHoeffner/jump.htm

A freeware Java compiler available for Win32, OS/2 and Linux. It also provides some extensions to the Java programming language, including templates, operator overloading, default parameters, namespaces etc. There seem to be no modifications to site and product since 1997.

Kiev

http://www.forestro.com/kiev/

A compiler for the Kiev language, which is an extension of Java. Distributed under the GNU GPL.

Kopi Java Compiler

http://www.kopiright.com/kopi_projekt.php

A source-code-to-bytecode compiler written in Java, distributed under the GPL.

Nice

http://nice.sourceforge.net/

A compiler for Nice, an extension of the Java programming language.

Pizza compiler

http://pizzacompiler.sourceforge.net/

A compiler for Pizza, an extension of Java, including generics, function pointers, class cases and pattern matching. The compiler distributed under the Artistic License.

Prototype Java compiler extension with generics

http://developer.java.sun.com/developer/earlyAccess/adding_generics/

A prototype compiler that adds generics to the Java programming language. Requires a Java Developer Connection account (available for free).

More about the new features can be learned on the page for Java Specification Request 201 - Extending the Java™ Programming Language with Enumerations, Autoboxing, Enhanced for loops and Static Import.

Timber

http://www.pds.twi.tudelft.nl/timber/index.html

Timber is a compiler for Spar, an extension of the Java programming language. It is developed as part of a research project. The compiler is distributed under the GPL. It relies on Kaffe's library of standard classes.