How to export exe from java
To export a Java project to an .exe executable file, you need to export the java project first to a .jar file, and then convert the jar file to an .exe file. The specific method is as follows:
1. Export the .jar file
1. Right-click the project - Export: (Recommended tutorial: java tutorial)
2.Java——Runnable JAR file——Next
3. Select Configuration - Export Path - Dependent Library Form - Complete
There are three export forms of dependent libraries here:
a) Extract required libraries into generated JAR means to extract the dependent jar into a class and throw it into the jar you generated. That is to say, the generated jar contains the decompressed file of the current package and the dependent jar. Unzip the file;
b) Package required libraries into generated JAR means to put the dependent jar directly into the generated jar without decompressing it, which means that the generated jar contains the dependent jar and is not decompressed;
c) Copy required libraries into a sub-folder next to the generated JAR means to put the dependent jar in the same directory where you generated the jar, that is to say, the dependent jar file is separated from the generated jar. Open under the build path.
Now you can find the generated jar file in the export path.
2. Convert jar files to .exe files
1. Install exe4j and run - next.
2."JAR in EXE" mode —— Next
3.Set the exported application short name—— —Export path—Next
4. Set the type of executable file—executable file name—icon file—Next
If you want to export a 64-bit executable file, you also need to set it up:
5. Add the jar file that needs to be converted—— Select the main class——Next
6. Set the jre version number range——Next
7.Next ——Next——Next.... Export completed
8. Running results
If you want to run it on other computers, you must Make sure that jre exists, or directly copy jre to other computers to run.
The above is the detailed content of How to export exe from java. For more information, please follow other related articles on the PHP Chinese website!