Compiled Native Interface
   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 w ...
to Java virtual machine (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 architecture Processor design is a subfield of computer engineering and electronics engineering (fabrication) that deals with creating a processor, a key component of computer hardware. The design process involves choosing an instruction set and a certain ...
s. 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 GNU Classpath is a free software implementation of the standard class library for the Java programming language. Most classes from J2SE 1.4 and 5.0 are implemented. Classpath can thus be used to run Java-based applications. GNU Classpath is a p ...
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
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
s in
GNU Classpath GNU Classpath is a free software implementation of the standard class library for the Java programming language. Most classes from J2SE 1.4 and 5.0 are implemented. Classpath can thus be used to run Java-based applications. GNU Classpath is a p ...
: 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
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 softwar ...
, 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 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 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++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
. CNI closely resembles the
JNI In software design, the Java Native Interface (JNI) is a foreign function interface programming software framework, framework that enables Java (programming language), Java code running in a Java virtual machine (JVM) to call and be called by n ...
(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,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. Like ...
*
SableVM SableVM was a clean room implementation of Java bytecode interpreter implementing the Java virtual machine ( VM) specification, second edition. SableVM was designed to be a robust, extremely portable, efficient, and fully specifications-compliant ...
*
JamVM JamVM is an open-source Java Virtual Machine (JVM) developed to be extremely small compared with other virtual machines (VMs) while conforming to the Java virtual machine specification version 2 (blue book). JamVM can be configured to use the GNU ...
* Apache Harmony *
Jikes Jikes is an open-source Java compiler written in C++. It is no longer being updated. The original version was developed by David L. "Dave" Shields and Philippe Charles at IBM but was quickly transformed into an open-source project contributed ...
*
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 *
Free Java implementations Free Java implementations are software projects that implement Oracle's Java technologies and are distributed under free software licences, making them free software. Sun released most of its Java source code as free software in May 2007, so it ca ...
* 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 mos ...
Java compilers Discontinued Java virtual machines