Introduction to Excelsior Jet
1. Introduction
--------
This example shows how to convert to a JRE-independent executable
A Java GUI using SWT instead of Swing/AWTProgram.
SWT is an open-source Java graphical user interface toolbox, which is independent of AWT and
Jfc/swing. Benefits of using SWT, together with other information,
You can find it below:
Http: // www.eclipse.org/platform/index.html
Http: // eclipsewiki.swiki.net/2
Http: // www.excelsior-usa.com/jetswt.html
SWT is part of an eclipse SDK. You can download it from the following:
Http: // www.eclipse.org/download/index.php
With SWT and Excelsior jet, you can greatly reduce
The size of the installation package for your Java graphic interface program. In particular,
If your program uses SWT instead of AWT/swing, Excelsior jet,
The Professional Edition enables you to compile it into a program that can run without a JRE.
As a result, your installation package only includes the following components:
-Runable Program
-SWT local method dll library (swt-win32-xxxx.dll)
-A subset of a jet Runtime Library (Dynamic Link Library)
-Attached Documents (manuals, examples, and so on ).
The following section 5th is a simple SWT program with a full installation package of about 4 MB.
Moreover, with the help of jetperfect global optimizer, it can further reduce the size.
To repeat it, SWT and Excelsior jet will help you get a program of reasonable size.
Make your program according to the specified size, let alone good performance and
InherentCodeProtection because the code is coded into local code by the compiler in advance.
2. About this example
--------------------
This example is a small program that draws the mandelbrodt set based on SWT.
The following file is inclided (this word is meaningless ):
Buildjar. Bat generates the script for mandset. jar.
Runjar. Bat runs the mandset script on the Java Virtual Machine.
Buildexe. Bat converts mandset. jar to the script of mandset.exe.
Java of the mandset. Java programSource code
Manset. ICO, which can run the icon file
Icon file in the title bar of mandset.gif
The mandset. MF record converts the mandset. jar file to a list file that can run the JAR file.
It is not a local program that can run-
Contains a package file of the class.
_ Mandset. prj Excelsior JET project file (generic name)
3. How to create
---------------
Make sure that javac.exe and jc.exe are in the environment variable path.
Assume that <eclipse_home> is the eclipse SDK installation directory.
Copy the following files
<Eclipse_home>/plugin/org. Eclipse. SWT/WS/Win32/SWT. Jar
<Eclipse_home>/plugin/org. Eclipse. SWT/OS/Win32/x86/swt-win32-XXXX.dll
To the directory that contains a file called "readme file. Note that the XXXX encoding is
A swt version number, for example, SWT 2.135 uses swt-win32-2135. dll.
Run buildjar. BAT to generate mandset. Jar
You can double-click to run runjar. bat.
Now, adjust the Excelsior jet file as follows:
-Open mandset. prj in the control panel of jet.
-Expand the "SWT. Jar" Node (or "org" node) on the display class page)
Until org. Eclipse. SWT. Internal. AWT (or org. Eclipse. SWT. AWT in
A newer version of SWT.
-Right-click org. Eclipse. SWT. Internal. AWT/org. Eclipse. SWT. AWT.
Node to cancel the "force into the project" selection. This will be removed from the compilation settings
AWT-SWT Bridge, this will produce
That does not require JRE to run.
-Select File/Save As..., enter "mandset. prj", and click Save.
-Close the jet control panel.
Run buildexe. BAT to generate mandset.exe.
4. How to prepare for Installation
------------------------------
Run jetpackii and select the new button on the splash screen.
Select a new package type.
Add mandset.exe and SWT-Win32-XXXX. DLL to the package on the file page.
Select "do not use JRE" on the JRE page ".
On the jet RT page, select the location of your program.
Run the test run.
Finally, select Excelsior installer.
On the Comprehensive items page, enter vendor data, such as company, product, and
And define shortcuts for the program.
Generate the installation package on the completion page.
The above is all the content. Now you can configure your program.
5. Package Size Discussion
-----------------------
This example is a small program. It has a size of several K.
Let's compare the installation package size:
Mandset. Jar + SWT. Jar + swt-win32-xxxx.dll, compressed: 1.0 MB
JRE needs to be pre-installed on the target system
Add JRE 1.3.1 to the same file, excluding selectable files. Compressed: 6.8 MB
Including JRE
Mandset compiled by jet, packaged in jetpackii: 3.6 MB
No JRE required
Mandset compiled by jetperfect global optimizer, compressed: 1.3 MB
No JRE required
---------
For more information about jetperfect, see the jet user guide for "jetperfect global optimizer.
Finally, test this example from ../jetperfect.