Create a Java installation file

Source: Internet
Author: User

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

Related Article

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.