Home  >  Article  >  Java  >  How to generate exe from java program

How to generate exe from java program

尚
Original
2019-12-28 09:53:028608browse

How to generate exe from java program

java program can use exe4j to generate exe. The implementation method is as follows:

1. First publish your program into a jar file

Publish java How to package a program into a jar file: How to package a java program

Convert the jar file to an exe file

1. The previously generated jar file , the following is the created directory structure

How to generate exe from java program

2. If you use it for the first time, you don’t need to worry about it. Click next

If you have saved the output configuration after use , you can choose open configuration

How to generate exe from java program

3. Enter Project type, select "JRA IN EXE" mode, click next

to display Application info

Fill in the program name in the upper box, select the output path in the lower box

How to generate exe from java program

4. Configure executableGUI application-->Check allow, fill in the file name in the lower box, icon file You can choose the icon file yourself. If you are restricted to opening only one program at the same time, check allow only a single. The other basic defaults are the default. If your exe4j and jdk have different digits, remember to check 32bit or 64bit in advanced options, otherwise the exe will be generated without error. It also cannot run correctly

How to generate exe from java program

5. Java invocation, click the green plus sign on the right side of the Class path box

and write the path of the jar file you generated into Archive ( All external jar packages used must also be added)

Then select the class containing the main method in the main class from box below

How to generate exe from java program

6, Minimum and Maximum Fill in the minimum and maximum jdk version numbers allowed Configure search sequence option. Only Search Windows registry

should be kept in the box. If not, add the green arrow on the right. After deleting the others, add the green arrow Directory

How to generate exe from java program

7. Find the jre we copied to the folder when we started, click finish

How to generate exe from java program

, and then the generated exe file will appear on the desktop.

For more java knowledge, please pay attention to the java basic tutorial column.

The above is the detailed content of How to generate exe from java program. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn