I. Java Packaging
1> export from eclipse
Manifest. MF: package list, mainly set the execution entry class and support LIBRARY PATH
Localized files: If SWT components are used, copy the SWT's local file swt-win32-3063.dllProgramRunning directory
META-INF/manifest. MF
Content:
Manifest-version: 1.0
Class-path:./lib/SWT. Jar./lib/jface. Jar
Main-class: jface. Dialog. Wizard. wizarddialog1
Write run. bat
Javaw-jar mypro. Jar
Start javaw-jar mypro. jar does not show a black command line window
Swt-win32-3063.dll in a separate native.
Start javaw-djava. Library. Path =./native/-jar mypro. Jar
2> Use jar.exe to package:
C:/JDK/bin/jar cvfm mypro. Jar E:/myeclipse/workspace/mypro/manifest.txt-C
E:/myeclipse/workspace/mypro/bin
Cvfm: jar.exe parameter, c creates a new jar package, V prints the debugging information on the screen, F specifies the generated JAR file name, M uses clear
Single file. All are in lower case
-C: package all files in the specified path
Ii. Use javalaucher to start jar with exe
Http://www.rolemaker.dk/nonRoleMaker/javalauncher/marner_java_launcher.htm
The downloaded file is a file named javalauncher.zip. The decompressed directory structure is as follows:
Javalauncher.zip directory structure
L The Source directory contains the javalauncher source program, which is written in C language.
L changes.txt is a new version modification description
L launch.exe is the main program
L launcher. cfg is the configuration file
L readme.txt is a description and example
We only copy the two files launch.exe and launcher. cfg to the directory where the package is located.
Launcher. cfg is a text file with only three lines of content. modify it as follows:
.
./Java1.4.2/JRE/bin/javaw.exe
-Jar myswt. Jar
L The first row sets the directory of jarpackage myswt.jar, because launch.exe and myswt. jar are in the same directory
"." Indicates the current directory.
L set the path to JRE/bin/javaw.exe in the second row.
After configuring launcher.htm, double-click launch.exe to run the Java application.
3. Use resorce hacker to change the EXE file icon
Http://www.angusj.com/resourcehacker/
4. Use InstallShield to create an installation file