GCJ: The GNU Compiler for the Java (remove your java program from JRE), GCJ environment Configuration

Source: Internet
Author: User
I used GCJ to compile itext and used itext to write many small programs (pdfrotate and nup_pdf can be obtained from the Internet now). Here I will only introduce how to obtain the GCJ compiling environment.

GCJ is a Java editor based on the GNU protocol. It supports the following compilation methods:
Java Source Code directly compiles the local machine code. On windows, the exe executable program (separated from JRE) is used );
Java source code is compiled into a Java bytecode (class file). It is estimated that only special circumstances make sense on the windows platform. After all, GCJ is not fully compatible with J2SDK;
Java bytecode compilation cost local machine code, similar to the first function;
That is to say, you can compile the local machine code for java source code or class files. This is the topic we are interested in.

There are three methods to obtain the GCJ compiling environment on Windows:
1. Go to http://www.thisiscool.com/gcc_ming?htmdownload tool kit,
Http://www.thisiscool.net/gcc34-20040607.tar.bz2
Http://www.thisiscool.net/gcc40-20051104.tar.bz2
As for which version is better, I will not waste time here based on my personal situation;
2. Download the independent tool package at http://sourceforge.net/and decompress it to a directory.
Http://prdownloads.sourceforge.net/mingw/gcc-core-3.4.5-20060117-1.tar.gz
Http://prdownloads.sourceforge.net/mingw/binutils-2.16.91-20060119-1.tar.gz
Http://switch.dl.sourceforge.net/sourceforge/mingw/mingw-runtime-3.9.tar.gz
Http://prdownloads.sourceforge.net/mingw/w32api-3.6.tar.gz
Http://switch.dl.sourceforge.net/sourceforge/mingw/gcc-java-3.4.5-20060117-1.tar.gz
Http://prdownloads.sourceforge.net/gnuwin32/libiconv-1.9.2-1-lib.zip
Http://prdownloads.sourceforge.net/gnuwin32/libiconv-1.9.2-1-bin.zip
Decompress all the above files to a specified directory. If you are prompted to overwrite them, click OK.
3. Go to http://gcc.gnu.org/java/download the latest source code and use the gcjtoolkit. (I have not tried it, but it is too troublesome)

Whether you use any of the above three methods, we recommend that you download another tool, UPX (for executable files, exe or dll for weight loss)
Http://prdownloads.sourceforge.net/upx/upx125w.zip? Download

To add the bin directory to the path, we have tested the first helloworld program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.