1. How to build a Java Project executable jar package through eclipse
First, export the jar file to the Java project under Eclipse
Next
Next
Next
After the last click, the executable jar file is generated. You can find it in the folder where you just selected the export directory.
2. Export the jar file that you just generated to the executable. exe file, first install the EXE4J software, as follows: http://www.jb51.net/softs/541579.html, download after the installation hack. Open the interface as follows
Directly next, select the second
Next
Next
If you want to run under 64 bits, click the button below and select 32bit or. If it is a 32-bit direct next
Go to the next screen and tick the
Next, Next, go to this interface, click "+" and then select the jar file you just generated, and if you have a third-party jar package, join it.
Click OK to go back to just the interface, select the program's entry class file
Next, select the minimum version of the JRE that can be run
If you are only running the next step in the native JDK environment, if you want to run without the JRE environment, you will need to add the JRE file installed under your JDK folder.
Click Advanced options to select Search sequence, go to the next screen, delete these two files
Then add your own JRE file, Note: The JRE file in the path to a layer of the JRE directory, that is, JRE\JRE, otherwise the generated EXEW file in its non-JRE environment of the computer can not run.
Back to just the interface
Always next, choose the default on it, and finally finish
Go to the exe file you just selected under Output EXE file to find just generated. Click Yes to run, but if you want to run it on a different computer, copy the JRE file and EXE to the other computer each time. So the next step is to compile the exe file and the JRE into a file that can be followed under Windows.
3, the exe file and the JRE compiled under Windows can follow the file. First to download Inno setup software online,: https://www.xp510.com/xiazai/Application/program/17984.html, download the installation after the Open interface as follows;
Select this and click OK
Next, default according to the file directory, other default.
Next, select the EXE file and the JRE folder you just generated
Next default
Next, these are the license files and installation statements, etc., you can not select
Next, step into this interface
Next, tick Yes
Next, complete. Choose Yes
Next, you can either keep or not save
Finally compile the interface, and then compile to build the files that can be installed
Locate the directory and the generated file for the file you just exported, and double-click Install. Directory after installation complete If this is the case, it means that everything is successful. If the files in the JRE and the files are in the same directory, the other computers that do not have the JRE environment will not run. The reason for this is that the directory of the JRE is not one layer lower, it should be this way: \jre\jre
Finally, that's it.
Java project generates executable jar packages, exe files, and installation files under Windows