GNU Compiler for Java
   HOME

TheInfoList



OR:

The GNU Compiler for Java (GCJ) is a free
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
for the
Java programming language Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers ''write once, run anywh ...
. It was part of the
GNU Compiler Collection The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU Project supporting various programming languages, hardware architectures and operating systems. The Free Software Foundation (FSF) distributes GCC as free softwar ...
for over ten years but as of 2017 it is no longer maintained and will not be part of future releases. GCJ compiles Java
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the ...
to
Java virtual machine A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describe ...
(JVM)
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
or to
machine code In computer programming, machine code is any low-level programming language, consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a ve ...
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 An eclipse is an astronomical event that occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three c ...
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 Swing or swinging may refer to: Apparatus * Swing (seat), a hanging seat that swings back and forth * Pendulum, an object that swings * Russian swing, a swing-like circus apparatus * Sex swing, a type of harness for sexual intercourse * Swing ri ...
. 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 Swing or swinging may refer to: Apparatus * Swing (seat), a hanging seat that swings back and forth * Pendulum, an object that swings * Russian swing, a swing-like circus apparatus * Sex swing, a type of harness for sexual intercourse * Swing ri ...
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
maintenance mode In the world of software development, maintenance mode refers to a point in a computer program's life when it has reached all of its goals and is generally considered to be "complete" and bug-free. The term can also refer to the point in a softwa ...
, with open-source Java toolchain development mostly happening within
OpenJDK OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only w ...
. GCJ was removed from the GCC
trunk Trunk may refer to: Biology * Trunk (anatomy), synonym for torso * Trunk (botany), a tree's central superstructure * Trunk of corpus callosum, in neuroanatomy * Elephant trunk, the proboscis of an elephant Computing * Trunk (software), in rev ...
on September 30, 2016. Announcement of its removal was made with the release of the GCC 7.1, which does not contain it. GCJ remains part of GCC 6.


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 In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard ...
for the GCJ that allows Java code to
call Call or Calls may refer to: Arts, entertainment, and media Games * Call, a type of betting in poker * Call, in the game of contract bridge, a bid, pass, double, or redouble in the bidding stage Music and dance * Call (band), from Lahore, Paki ...
, 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 machine A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describe ...
s.


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,The example comes from: https://gcc.gnu.org/onlinedocs/gcj/Objects-and-Classes.html#Objects-and-Classes given a Java class, public class Int one can use the class thus: #include #include Int *mult(Int *p, int k)


See also

*
Excelsior JET Excelsior JET is a now-defunct proprietary Java SE technology implementation built around an ahead-of-time (AOT) Java to native code compiler. The compiler transforms the portable Java bytecode into optimized executables for the desired hardware a ...
(Excelsior Java native code compiler) * IcedTea *
Kaffe Kaffe is a discontinued "clean room design" ( reverse engineering) version of a Java Virtual Machine. It comes with a subset of the Java Platform, Standard Edition (Java SE), Java API, and tools needed to provide a Java runtime environment. L ...
* SableVM * JamVM *
Apache Harmony Apache Harmony is a retired open source, free Java implementation, developed by the Apache Software Foundation. It was announced in early May 2005 and on October 25, 2006, the Board of Directors voted to make Apache Harmony a top-level project ...
* Jikes *
GraalVM GraalVM is a Java VM and JDK based on HotSpot/ OpenJDK, implemented in Java. It supports additional programming languages and execution modes, like ahead-of-time compilation of Java applications for fast startup and low memory footprint. The f ...
- GraalVM's Native Image functionality is an ahead-of-time compilation technology that produces executable binaries of class files. *
Java virtual machine A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describe ...
* Free Java implementations * Kotlin - Kotlin/Native is a technology for compiling Kotlin to native binaries that run without any JVM. It comprises a
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate repre ...
-based backend for the Kotlin compiler and a native implementation of the Kotlin runtime library.


References


External links

* * * * {{DEFAULTSORT:Gnu Compiler For Java Free compilers and interpreters
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
Java compilers Discontinued Java virtual machines