Java program to generate exe Executable File detailed tutorial (text description), java Executable File
The ava program is packaged into an exe executable file, which is divided into two steps.
Step 1: import a Java program into a Jar package through Eclipse or Myeclipse
Step 2: Use exe4j to generate the exe executable file by using the Jar package program
Step 1:
Generate a Jar package from a java program
The following is the Jar package exported from Myeclipse. First, select project "right-click"
Click "Export"
Select JAR file
Only check the src directory under the project. config and lib are the Jar packages required by the configuration file and program.
Click "next"
Select the Main method and click Finish.
Only warning, no need to pay attention.
Okay, until the Java program Jar package is generated in the previous step.
Step 1 is complete.
Now start the second step:
Exe4j encapsulates the Jar package in exe
First, create a folder under a drive letter. In this example, a Java folder is created on drive D, then, place the Jar package files required by the jre and program and the configuration files to be read by the Java program into the folder.
Okay. Now, first open the exe4j program.
Step 1: click "Next" without any operation"
Step 2: select the second "JAR in EXE" mode and click "next"
Step 3: click "next" after setting"
Click "next"
Click "next"
Click "next"
After setting the size and version number, click "Search sequence" on the right node"
Click "Green plus sign" and select "Directory" to add JRE. JRE is the first step to create the JRE in the folder.
The "7, 8, and 9" step is the default value. In step 10, follow the image
Click "Save as" to Save a local file without any need. Then, go to the path of the exe you saved in the second part and find your exe file.
It's done.