How do I turn my Java program into an EXE file?

Source: Internet
Author: User

Java is a "cross-platform" language, with "write once, run Everywhere" feature, let it become today's IT industry, an indispensable programming language. After each software development, we should all need to package the program and send to the customer, the common way: Java program into a jar package, the Web program into a war package after the completion of a certain transmission mode, transmission to the customer to let it run. War package We do not elaborate here, mainly on the problem of the jar package, the jar package must be run in the JRE environment, and need to pass the "Java-jar path/*.jar" instructions to complete the operation, many customers do not know this command, it is difficult for him, Every time we programmers to run their own, then there is no better way? In fact, in the Windows operating system, we are most familiar with the EXE program, if we can all be able to package jar file as exe file, then the customer can help us to start the program, next, we will see how to convert a jar package into an EXE file!

First, use the development tools to create a jar package

Next, use the development tool to quickly build a jar out:

We then copy the jar package to the E-drive under the jar file:

Step two, go to the website to search and download the exe4j tool
We go to the website to download the conversion tool, http://www.onlinedown.net/soft/9475.htm of course, I am here to download the 64-bit system

The corresponding software, after the download is complete, please unpack and execute the installation exe4j_windows-x64_5_01.exe

After the installation, run the EXE4J Wizard program, the following interface will appear:


Click "Next" directly and go to the "Project type" Selection page:


Select Click "Next" and go to "Application Configure" page:


In this page, we need to modify 3 places, the first input box, we need to give us a package of programs, a "nickname son",

For example: Dog Wanderers Second, in the third input box, we fixed the selection of the directory where the Jar is located. When you are finished, click "Next",

Go to the "executable Configure" page:


In this page, there are 3 places to be corrected, the first place please select "Console application", after the run, will be

The Doc form appears. The second place, give us an application name. The third place, mainly to let our application in the

Only one in the process. When you are ready, click on "Advanced Options" and select "32-bit or 64-bit" to enter 64-bit soft

Select a page.


In the page, choose to install according to 64-bit installation, select OK, after the connection click 2 times "Next" to the most important configuration page:


In this page, we first need to click on the "+" number, add our Jar file, and then select our Jar package in the main entry class, also

Is the class that contains the main function. After the selection, please click "Next", in the JRE version of the page to enter the minimum version, such as: 1.7,

Then our program will not be able to run on version 1.6. So try to set it down a little bit!


After the configuration, click "Next" to complete the conversion work, and then we open the E:/jar directory, we should be able to see our EXE file.

Double click EXE file, we can normally start our program, O (∩∩) o hahaha ~, happy not?

Over, of course, there are many ways to convert jar files to exe, and I'm just introducing one of them. Exceptions, give everyone the need to explain

Yes, if you pay attention to comparing the size of the jar file with the exe file, you will find that the EXE file is much larger than your jar file size. Is it really?

Outweigh The best is a comprehensive balance, there is no perfect thing in the world.

How do I turn my Java program into an EXE file?

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.