How to generate a Java exe program using exe4j

Source: Internet
Author: User

Today, I found a lot about how to use exe4j to generate Java exe.

The detailed steps are as follows:
1. Welcome-open exe4j

If you have saved the project packaging configuration file, click> open. If there is no point> next.

2. Project type-select the packaging method

Because we are talking about packaging jar to generate EXE, we select "jar in EXE" mode. In this way, we can package a Java application into an EXE file, however, you cannot package additional files except jar files. Then> next

3. Application Info-configure the information of the generated Application

Set the name of your application and the output folder of the executable file to be generated. Then> next.

4. executable Info-configure the parameters of the executable file

Type is determined based on the type of your program. In this example, it is a GUI program; next, the file name, the executable file icon, whether to allow only one application to run at the same time, whether to throw an exception when the main thread encounters an error, and change the working directory (relative to the executable file ). Click> advanced options> version info.

5. version info-set version information

6. Java invocation-configure the runtime environment

First configure the class path, delete all the original configurations in this item, and click "+" to find the JAR file you generated,

Then click the Browse button in the general section above. exe4j will automatically find the main class entry for your application.
Select native libraries settings in the advanced options below. This function is used to add external jar package files used by your program, which I have never used, because I like to concentrate on everything, therefore, all the external packages used in the program are fully integrated into JDK/JRE. This way, you only need to pass the program to the client when installing the program, no need to install other things, they will like it very much. After all, users are not engaged in programming.

7. JRE-configure JRE

Configure your JRE version type here, and then see> advanced option> search sequence


Here, you can configure the location of the JRE/JDK required to run the program. If you only run the program on the local machine after packaging, you can directly specify the JRE/JDK directory on your local machine, if the packaged program is to run on another client and the machine does not have JDK installed, another method is required. From the customer's point of view, the software should be installed as little as possible to bring tedious installation matters to the customer, it is best to just click the mouse to automatically install. Therefore, we need to save the trouble of installing JDK. To solve this problem, we can place the installed JDK copy in the root directory of the final product, and then add this JDK copy to the running environment of the program.

Search registty can scan installed JDK/JRE. We select directory to specify a JDK directory for the program. You only need to locate the JDK root directory, as shown in. Then> next
It should be noted that only one JRE is required for the program developed with eclipse, and JDK is not needed. Therefore, I package JRE into the EXE runtime environment, in this case, the option under Java version that allows the use of JRE beta version will be selected.
8. Preferred VM-select Virtual Machine

This is selected based on the actual situation. This example is client. Then> next

9. Splash Screen-preload form

You can set your preload form interface here, but it seems that you only recognize GIF images. Status line and version line can adjust the display position on the position text lines visually preview interface. Next, select the language interface and select the language based on your needs. Then> next

10. Compile executable-compile and generate an executable file

Automatically jump:

Here, you can click the generated executable file, or save the configuration scheme for future use.
In addition, if the generated EXE is opened, the pop-up box is displayed because exe4j is not registered. No more after registration. Register in welcome.

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.