Samiksha Jaiswal (Editor)

GNU Compiler for Java

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
The GNU Project

Operating system
  
Unix-like

License
  
GNU GPL

Stable release
  
6.3 / N/A

Type
  
Compiler

Preview release
  
7.0 / May 22, 2016; 9 months ago (2016-05-22)

The GNU Compiler for Java (GCJ) was a free compiler for the Java programming language and part of the GNU Compiler Collection.

Contents

GCJ could compile Java source code to Java Virtual Machine bytecode or to machine code for a number of CPU architectures. It could also compile class files and whole JARs that contain bytecode into machine code.

History

The GCJ runtime-libraries original source is from GNU Classpath project, but there is a code difference between the libgcj libraries. GCJ 4.3 uses the Eclipse Compiler for Java as a front-end.

In 2007, a lot of work was done to implement support for Java's two graphical APIs in GNU Classpath: AWT and Swing. Software support for AWT is still in development. "Once AWT support is working then Swing support can be considered. There is at least one free-software partial implementations of Swing that may be usable.". The GNU CLASSPATH was never completed to even Java 1.2 status and now appears to have been abandoned completely.

As of 2015, there were no new developments announced from GCJ and the product was in deep maintenance mode. In 2016, GCJ was in the process of being removed from GCC and was deleted in October.

Performance

The compilation function in GCJ should have a faster start-up time than the equivalent bytecode launched in a JVM when compiling Java code into machine code.

Compiled Native Interface (CNI)

The Compiled Native Interface (CNI), previously named "Cygnus Native Interface", is a software framework for the GCJ that allows Java code to call, and be called, by native applications (programs specific to a hardware and operating-system platform) and libraries written in C++.

CNI closely resembles the JNI (Java Native Interface) framework which comes as a standard with various Java virtual machines.

Comparison of language use

The authors of CNI claim for various advantages over JNI:

CNI depends on Java classes appearing as C++ classes. For example, given a Java class,

one can use the class thus:

References

GNU Compiler for Java Wikipedia