The Java program is packaged into an EXE executable file, which is divided into two major steps.
Step one: Use Java programs through eclipse or MyEclipse as a jar pack
Step two: Generate EXE executable by EXE4J talk jar package program
The first step is detailed:
To generate a jar package from a Java program
The following is MyEclipse Export jar package, first select project "Right click"
Click "Export"
Select Jar File
Keep only the SRC directory below the project check, Config and lib for the configuration file and the required jar package for the program
Click on "Next"
After selecting the main method, click Finish directly
Just a warning, no attention.
OK, until the previous step, the Java program jar package was generated.
The first big step is complete.
Let's start with a second big step:
EXE4J the jar package for EXE encapsulation
First create a folder underneath a letter, this example is a Java folder set up in D disk, and then put the JRE and the jar files required by the program and the configuration file that the Java program reads to the folder.
Okay, start now, open the EXE4J program first.
First step without action, click "Next" directly
Step Two: Select the second "JAR in EXE" mode and click "Next"
Step three: After the setup is complete, click "Next"
Click on "Next"
Click on "Next"
Click on "Next"
After setting the size version number, click the "Search sequence" on the right node.
Click "Green Plus" to select "Directory" Add Jre,jre is the first step in creating a JRE in a folder
Then the "7, 8, 9" Step by default, the tenth step, the picture operation
After successful, click the "Save as" button, casually save a Place "save", this file does not need to, and then to the second you save the EXE that path, find your EXE file.
It's done.