Use exe4j to create a pseudo-EXE file

Source: Internet
Author: User

Principle: executable jar package files can be executed through the command line Java-jar jarfile. jar. Create a pseudo-exeproject. You only need to create an exeproject and use java.exe in the system to run it.
Generally, executable files made of exe4j still need to be supported by JRE, that is, they can only run on the computer where JRE is installed. However, there is a way to create a pseudo-EXE file and run it on a machine without JVM installed: Although exe4j does not provide the JRE packaging function, it provides a method to search for JRE. In item 6, set [JRE] to [search sequence], add a directory-based search entry, and specify the relative directory ". ", and then copy the bin and Lib directories in the JRE directory to your release directory. (Of course, you do not need to use the current directory ".", or any other directory under the current directory, such as "./JRE ). At this time, the EXE file generated in the release directory will call the JRE in the current directory at runtime, instead of searching for jre through the system registry and environment variables, therefore, you only need to copy the entire release directory (including EXE and bin and Lib of JRE) to other computers, and "the target machine can be executed even if JRE is not installed" is realized ". Of course, this release method cannot obtain a separate EXE file containing JRE. In addition, the complete JRE directory is 50 MB, but ourProgramIt is possible to call only a few of them. You can manually lose weight for the JRE in the release directory and Remove unused files, but this requires some experience. After losing weight, the JRE can be at least 10 MB based on different applications.
If an error is reported after the package is completed, the error may be due to the absence of registration.

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.