以 Eclipse Mars 为例, right click project.., 按 Export...
1. Select
Select an export destination:
- 1.1.1) 选 Java 里的 JAR file
或
- 1.2.1) 选 Java 里的 Runnable JAR file (如果有用其它 JAR library)
按 Next >
1.1.2. JAR File Specification
Select the export destination: JAR file: C:\*.jar
按 Next >
按 Next >
1.1.3. JAR Manifest Specification
a) Specify the manifest: 选 Generate the manifest file
b) Seal contents: 选 Seal some packages
c) Select the class of the application entry point: Main class: 例子 com.*.mainClass
按 Finish
1.2.2) Runnable JAR File Specification
a) Launch configuration: 例子 mainClass-Name - Project-Name
b) Export destination: C:\*.jar
c) Library handling: 选 Extract required libraries into generated JAR
按 Finish
2. JAR 档案完成后, 去下载 launch4j-3.8-win32.zip
http://launch4j.sourceforge.net/
运行 launch4j.exe
a) Basic - Output file - C:\*.exe
b) Basic - Jar - C:\*.jar
c) Header - GUI / Console
d) JRE - Search options - Min JRE version: 1.0.0
e) 按图标 Save configuration - 存你所设定的 config files (.xml, .cfg)
f) 按图标 Build wrapper
Log 会显示 Successfully created C:\*.exe
没有评论:
发表评论