Home > Article > Operation and Maintenance > what is linux gcj
In Linux, GCJ is GNU's Java compiler. It can compile java programs into local code. After successful compilation, the executable file can be run directly without jre. After compiling into local code, the executable file can be run directly. The speed is improved, but the disadvantage is that the generated files are larger. GCJ can compile Java source files into Java bytecode files or directly compile Java source files into local machine code. It can also compile Java bytecode files into local machine code.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What is linux gcj
GCJ is the abbreviation of GNU Compiler for the Java Programing Language. It is GNU's Java compiler, which can compile java The program is compiled into local code. The executable file after successful compilation no longer requires jre and can be run directly. The running speed of the program after compilation into local code is improved. The disadvantage is that the generated file is larger.
Inside GCC, it contains the front end of the Java programming language (gcc/java), a runtime library (libjava) and other tool libraries (boehm-gc, libffi and zlib). Most runtime library implementations are shared in the GNU Classpath project.
GCJ is a lightweight, high-performance Java language compiler. It can compile Java source files into Java bytecode files or directly compile Java source files into local machine code. It can also compile Java bytecode files into local machine code.
The compiled application is linked with the GCJ runtime libgcj. The runtime provides the core class library, garbage collector and a bytecode interpreter. libgcj is able to dynamically load and interpret class files, producing hybrid compiled/interpreted applications. The runtime is integrated into a project with the same name as GNU Classpath. Supports at most jdk1.4 class libraries and some jdk1.5 class libraries.
GCJ can also be configured as a cross-compiler suitable for embedded systems. Recent GNU Debugger (gdb) supports GCJ. For a simple tutorial on using gdb to debug Java programs, see the reference materials.
gcj installation
##http://www.sjsjw.com/kf_www/article/48_13877_22103.asp
Use gcj command
FirstApp.javapublic class FirstApp { public static void main(String args[]) { System.out.println("This is a test."); } }Compile
gcj --main=FirstApp -o FirstApp FirstApp.oRun Related recommendations: "
Linux Video Tutorial"
The above is the detailed content of what is linux gcj. For more information, please follow other related articles on the PHP Chinese website!