Java projects packaged into EXE format

Source: Internet
Author: User

Http://wenku.baidu.com/link?url=x9p2QO7uYD7VLh8740A_7T_r491TYPQgMva7E6k8eUKqia1Y8Ww_ Shodsmj5oucevig0zfpytqhm0r1gwzfek5mhs6o8_hryjtbvfuj1xis

1. Packaged as a jar file with MyEclipse

Right-click on an item to export (export)

Pop-up window select Runnablejar file Next

Launch Configuration Select Home * (Project start Page)

Export Destination Select storage location

As shown in figure:

Click Finish to complete

This is a running jar package that can be run at the command line, but requires a JRE environment

(Run the command "Java–jar your Jar package") as shown:

2. Use exe4j to make the jar package into EXE format

First build a folder as shown:

File: I put the temporary file (can not)

Res: is a resource file, such as a picture, configuration file, etc. (Can not be)

JRE: This is a must, with it can not install the Java environment

Exe4j.exe Download Address: http://www.ej-technologies.com/download/exe4j/files.html

After downloading is compressed package, do not need to install

Find Bin directory after decompression

Double-click Exe4j,

Direct Next

Select the second "JAR in EXE" and next

The first empty fill, the second select the folder you just created, that is, the path to the build EXE, next

Executable type Select a project format, choose the first

Executable name fill in the names of the EXE to be generated

Icon file Select the icons that generate the EXE (must be. ico format)

Next

VM Parameters: Filling in-dexe.path=${exe4j_exedir}

You can use him in the program to find the EXE directory, so no matter where the generated EXE can be found in the current directory, usage (String ExePath = System.getproperty ("Exe.path");

Click Green,

Archive Select the jar package that you just built with myeclipse

Click OK class path to generate the following effect,

Main class Select the page where the main method is located, which is your homepage, and click the button behind the main class

Select your page, click OK, Main class will appear your first name,

The rest is not filled, the next step

The first input box fills in your JRE version,

Click, select Search Sequence,

Select your JRE package (so that you do not need to install the JDK environment on the machine)

Delete all three of them first.

In the figure, click, select Directory, select the JRE path (JRE in the folder you created first)

Click OK

Next, select the client Hostspot VM

Next, configure the EXE Run-time transition interface diagram

Select a second, and select a picture

Click Next,

No operation, direct next, that completes the

can be clicked to test

my files are as shown

Double-click to run

Related Article

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.