GCJ disconnects java programs from jre execution

Source: Internet
Author: User

First, download the following software:
1 http://sourceforge.net/projects/mingw/
MinGW-5.1.3.exe

2 http://sourceforge.net/projects/gnuwin32/
Libiconv-1.9.2-1-bin.zip
Libiconv-1.9.2-1-lib.zip

The above is the latest version at that time. With the latest version, please select the latest version to download.

Installation 2
1. To install mingGW, You must select the following options:
Mingw-runtime
Mingw32-make
Gcc-java
By default.
2. Install libiconvand decompress libiconv-1.9.2-1-bin.zipand libiconv-1.9.2-1-lib.zip to the mingGW installation directory.

3. Preparation Environment
1. Add the bin directory of minggw to the path system variable;
2. To compile a java program using gcj, You need to block the jdk environment variables. To avoid affecting the normal use of jdk, write the following bat and name it j2e. bat for backup:

@ Echo off
Set CLASSPATH =
Gcj-c % 1. java-o % 1.o
Gcj -- main = % 1-o unzip 1.exe % 1.o

3. Write a java class with the following content:
Public class Hello
{
Public static void main (String [] args) throws Exception
{
System. out. println ("Hello exe4j ");
}
}

4. Compile:
Run j2e hello, and the program generates hello.exe. Check carefully and find that the file is large, because he has packaged the jre.

5 deployment:
Is it okay to take this hello.exe ?? No. You must also bring libiconv2.dll. Do not forget.

 

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.