Using EXE4J to package the jar build exe
Tools you need to use Eclipse to package, exe4j tools for generating EXE files, this is necessary. We can download the 4.0 version of the Internet.
First, select a project in eclipse that you want to guide, then write click File, choose Export in the pop-up option, and then select Runable JAR
File option,
Next, select the item you want to guide the package to and guide it to the place you want,
Click Next to select Details in the pop-up prompt box.
Select the class in your project that contains the main function in the pop-up chassis
No problem!
Let's start with the detailed steps:
1.welcome-Open exe4j
If you have a saved project package configuration file, click >>open to open it. If there is no point >>next.
2.Project
Type-Select Package method
Since we are talking about packaging jar build exe, select "Jar
In
EXE mode, this way you can package a Java application into an EXE file, but you can't package additional files except the jar. Then >>next
3.
Application info-configuration-generated application information
Set the name of your application and the output folder of the executable file that will be generated. And then >>next.
4.Executable
Info-Configure parameters for executable files
The type item is determined according to your program, and this example is a GUI program, followed by a filename, an icon for an executable file, whether only one application can be run at a time, if an exception is thrown when the main thread is wrong, and the working directory is changed (as opposed to an executable file). Then dot >>advanced
Options>>version Info
5.version
Info-Set Version information
6.java
invocation-Configuration Run Environment
Configure class First
Path, remove the original configuration from this key, and then click "+" to locate the jar file you generated,
Then in the general midpoint of the above button, EXE4J will automatically find your application's entry-main
Class
At the bottom of the advanced
Options selected native
Libraries settings, this feature is to add your program to use the external jar package file, which I have been used, because I like to do everything to concentrate, so in the application of all the external packages are integrated into the JDK/JRE, This is to install the program to the customer as long as the program directly to his test in the past can be used, no longer install other things, they will like Oh, after all, the user is not engaged in programming.
7.jre-Configuration JRE
Configure your JRE version type here, and then look at the >>advanced
Option>>search sequence
Here to configure the location of the jre/jdk you need to run the program, if you just pack the machine to run, directly assigned to your local JRE/JDK directory, if you package the program to run on other clients, and the machine does not install JDK, then we will think of another way. From the customer's point of view, take the hand of the software in the installation process should be as little as possible to the customer to bring cumbersome installation matters, it is best to click the mouse can automatically install. Therefore, we want to save users from installing JDK. To resolve this issue, we can place the installed JDK copy in the root of the final product, and then add the JDK copy to the program's operating environment in the figure above
Search
Registty can scan already installed JDK/JRE, we select Directory, specify a JDK directory for the program, just navigate to the JDK root directory, as shown above.
Then >>next
The point here is that the program developed with Eclipse is just a JRE, JDK doesn't work, so I'm packing the JRE into an EXE-run environment, so that the one below Java version allows the JRE to be used
The options for the beta version will be selected.
8.preferred
vm-Select Virtual Machine
This is chosen according to the circumstances, and this example is client.
Then >>next
9.splash
Screen-pre-download form
Here you can set up your preload form interface, but it seems to be a GIF type of picture, status
Line and version line can be position text lines
Adjust its display position in the visually preview interface. Then >>next, next is to choose the language interface, according to their own circumstances. Then >>next
10.compile
executable-Compile Build executable file
Auto Jump to:
You can click here to run the generated executable file, or you can save this configuration plan for later use.