- Java
- GNU
- C++
- Java (platform perangkat lunak)
- C Sharp (bahasa pemrograman)
- AArch64
- Bahasa pemrograman domain khusus
- Notasi ilmiah
- Pengembangan perangkat lunak Android
- SPARC
- GNU Compiler for Java
- Java compiler
- GNU Compiler Collection
- GNU Classpath
- Java bytecode
- Ahead-of-time compilation
- Javac
- Java Development Kit
- Free Java implementations
- GCJ
gnu compiler for java
GNU Compiler for Java GudangMovies21 Rebahinxxi LK21
The GNU Compiler for Java (GCJ) is a discontinued free compiler for the Java programming language. It was part of the GNU Compiler Collection.
GCJ compiles Java source code to Java virtual machine (JVM) 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 maintenance mode, with open-source Java toolchain development mostly happening within OpenJDK. 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, 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:
We use CNI because we think it is a better solution, especially for a Java implementation that is based on the idea that Java is just another programming language that can be implemented using standard compilation techniques. Given that, and the idea that languages implemented using Gcc should be compatible where it makes sense, it follows that the Java calling convention should be as similar as practical to that used for other languages, especially C++, since we can think of Java as a subset of C++. CNI is just a set of helper functions and conventions built on the idea that C++ and Java have the *same* calling convention and object layout; they are binary compatible. (This is a simplification, but close enough.)
CNI depends on Java classes appearing as C++ classes. For example,
given a Java class,
one can use the class thus:
See also
Excelsior JET (Excelsior Java native code compiler)
IcedTea
Kaffe
SableVM
JamVM
Apache Harmony
Jikes
GraalVM - 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
Kotlin - Kotlin/Native is a technology for compiling Kotlin to native binaries that run without any JVM. It comprises a LLVM-based backend for the Kotlin compiler and a native implementation of the Kotlin runtime library.
References
External links
"Official website". GCC. GNU. Mar 30, 2007. Archived from the original on May 9, 2007.
"GCJ Manual". Archived from the original on August 22, 2016.
"About CNI". GCJ Manual. Archived from the original on July 28, 2016.
Wielaard, Mark (Apr 6, 2005). "GCJ - past, present, and future". LWN. Archived from the original on August 2, 2019.