Java projects generate executable jar packages, exe files, and installation files under Windows

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.