As of GCC 7, the GCC Java frontend and associated libjava runtime library have been removed from GCC. The information on this page is kept here for reference but only applies to GCC 6 and earlier.


GCJ stands for the GNU Compiler for the Java Programming Language. Within GCC, it comprises the Java programming language front-end (gcc/java), a runtime library (libjava) and other helper libraries (boehm-gc, libffi and zlib). Most of the runtime library implementation is shared with the GNU Classpath project.

GCJ can compile Java source files to native code or to Java bytecode and can also compile Java bytecode to native code.


In the late 1990s, Cygnus Solutions started a project to create an ahead-of-time (AoT) native compiler for Java based on GCC and primarily targeted at embedded systems. The first version was released in 1998. It was merged into the GCC CVS repository by late 2000. An early name for GCJ used to be gjavac.


GCJ supports most of the Java Language Specification and a fairly large number of runtime APIs when compared to Sun's JDK 1.4. It does not have any support for the newer language and runtime features introduced in JDK 1.5.

GCJ has been ported to many architectures, though not as many as those supported by the C front-end in GCC.

GCJ_Bug_Digest (not up to date)

Binary Compatibility ABI

GCC 4.0 includes a preview implementation of a new Binary Compatibility ABI for GCJ for pre-compiled Java applications. It is enabled by compiling Java bytecode using the -findirect-dispatch flag (and right now, some other flags, although we hope to simplify that). See How_to_BC_compile_with_GCJ for full details.

Tips and Hints

This section is for useful information for users and/or developers of gcj which hasn't yet made it into the documentation (which, incidentally, can be accessed with "info gcj" on a gnu system).

Unrealized GCJ Improvement Opportunities

Ideas about how GCJ could be improved.


Here is an alphabetically ordered list of some current and past GCJ hackers:

None: GCJ (last edited 2017-08-07 10:10:17 by JonathanWakely)