The Java program is packaged into an EXE executable file, divided into two major steps.
The first step: MyEclipse a Java program into a jar package via eclipse or
Step two: Generate EXE executable by exe4j speaking jar package program
The first step is detailed:
Generating a jar package from a Java program
Here is the MyEclipse export jar package, first select the project "right click"
Click "Export"
Select Jar File
Only the SRC directory underneath the project is checked, Config and Lib are the jar packages required for configuration files and programs
Click "Next"
After selecting the main method, click Finish directly
Just a warning, no concern.
OK, until the previous step, the Java program jar package was generated.
The first large-step operation is complete.
Now start the second big step:
EXE4J the jar package in EXE package
First set up a folder under a drive, this example is the Java folder set up in the D disk, and then the JRE and the program required by the jar package file and Java program to read the configuration file into the folder.
OK, now start, first open the EXE4J program
First step without action, click "Next" directly
Second step: Select the second "JAR in EXE" mode, then click "Next"
Step three: When Setup is complete, click "Next"
Click "Next"
Click "Next"
Click "Next"
After setting the size version number, click "Search sequence" on the right node
Click "Green Plus" to select "Directory" to add Jre,jre is the first step in creating the JRE in the folder
Then "7, 8, 9" Step by default, the tenth step, by the picture operation
After success, click the "Save as" button, just save a Place "save", this file is not used, and then to the second you save exe that path, find your EXE file.
It's done.
Java program generation EXE executable file