Use exe4j to package java jar files into exe applications

Scenarios using exe4j

  • Sometimes we use the java language to develop a tool with an interface, and if we want to run this tool on the windows system, then using exe4j is a good way

Practice

  • First of all, we need to download the exe4j installation package. Here is a download address: Windows version of exe4jV8.0-Desktop System Documentation Resources-CSDN Download
  • After downloading, decompressing and installing, run exe4j
  • We can "Open" a .exe4j file, which is the configuration file saved after using exe4j before, or start a new one, click "Next" to enter the next interface
  • Select the "JAR in EXE" model, then click "Next"
  • Then fill in the application name you expect, such as "LCQ Gadget", and then select the output path of the exe, such as "D:\LCQ-TOOL", and then click Next
  • Then configure the executable file. We choose the Executable type as GUI application Executable name and fill in whatever you want. The ICON to start selects a file with the suffix ".ico", and the others are checked by default, and then click "Next"
  • This interface needs to select our jar package, click the plus icon in the upper right corner, select the jar file, and configure the Main startup class of the jar file after selection. Click the ''...' on the right to list all the jar packages. A class with a main method, just choose one, this class will execute the main method to start our application, and then click "Next"
  • Select the minimum and maximum version of JDK, and other configurations, and then click "Next"
  • You can configure the startup splash screen page of the application, or you can not configure it, and then click "Next"
  • Select the language and click "Next"
  • Ok, this step shows that the exe executable file has been generated. We can directly click "Click Here to Start the Application", and we can see that the LCQ gadget.exe file has been generated in the output directory. We can click it directly run
  • Sometimes you may encounter this situation when running
  • This is because the JDK environment is used inside the jar package you execute, but the JDK or JRE path is not specified.
  • This tool is very cool, so that the tools we develop in java can easily run on windows, and the interface developed by java fx can also run on the desktop

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/qq_19942717/article/details/126002854