Home  >  Article  >  Operation and Maintenance  >  what is linux gcj

what is linux gcj

青灯夜游
青灯夜游Original
2023-04-21 18:22:291627browse

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.

what is linux gcj

#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

what is linux gcj

Use gcj command

FirstApp.java

public class FirstApp
{ 
    public static void main(String args[])
        {
            System.out.println("This is a test.");
      }
}

Compile

gcj --main=FirstApp -o FirstApp FirstApp.o

Run

what is linux gcj

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn