function: To talk about how to build a Java Project executable jar package through eclipse, and how to make the jar package into ext file through exe4j;
= "Java Project
1. Java Project build jar package
(1), "project" right key-> "Export ...", pop-up "Export Settings" window as follows:
(2), select the file to be packaged, the following figure:
(3), set the export hint information, the following figure:
(4), the designated program entrance, as shown:
(5), view the results, as shown in the figure:
2. Use exe4j to generate executable. exe files
able to generate an. exe file, there are a lot of software to check, I only use exe4j, first to download (address: http://www.ej-technologies.com/download/exe4j/files) a exe4j and installation. Assuming your project is packaged into a jar file, you can do the following.
(1), preparatory work
First, create a folder in any directory, preferably named and project name, where I create a HelloWorld (ant) folder on the D:\2JavaWorkRoom3\exefile\HelloWorld (ant) path. Then copy all the resource files and our generated executable jar files (my Antdemopro.jar) to this folder, and if you want the other computer to be able to use the program without installing the JDK, you need to copy the JRE directory on your machine, I installed the Jre8, the final directory structure is as follows:
Start exe4j, the Welcome interface is as follows:
(2), choose Packing Way: "JAR in EXE" mode;
(3), application configuration;
(4), configuration executable file;
(5), configure the operating environment;
Clear the original class path path under the class path, click "+" on the right to select the packaged jar file, and select the entry class in main class, that is, the class containing the main function;
(6), configure JRE;
If you want to bundle the JRE in this program, go to the Configure search sequence option:
Delete all other directory, especially if there is "Java_home" or "jdk_home" must be deleted, because he will save your local java_home address, installation will appear path can not find the error; will search Windows Registry reserved, if not, please click Green "+", select "Search Registry", then click "OK", click Green "+" to select the bundled JRE location;
Select one of the preferred VMS-select the type of virtual machine, I chose the Default vm;
(7), the rest of the steps directly next to the good; if you generate an EXE file, you may be prompted every time you open it: This executable is created with a evaluation version of EXE4J
This is because you have not registered EXE4J software, after registration will not be prompted. Can try this registration code: L-G782DN2D-1F1YQXX1RV1SQD;
In this way, click EXE file, you can directly run, but a little flaw: is EXE file must have a Jre8 folder, otherwise not run. However, in the next article, we will make the EXE executable file in Windows can be installed under the software is good.