Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:请问 Excelsior JET 怎样使用? [Re:ysonic]
ysonic





发贴: 37
积分: 0
于 2005-06-14 21:18 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我的是e文:
==============================================
1. Intro
--------

This sample illustrates how to convert to a JRE-independent executable
a Java GUI application that uses SWT instead of Swing/AWT.

SWT is an open source Java GUI toolkit independent from AWT and
JFC/Swing. Benefits of using SWT, as well as other information,
can be found at:

http://www.eclipse.org/platform/index.html
http://eclipsewiki.swiki.net/2
http://www.excelsior-usa.com/jetswt.html

SWT is a part of Eclipse SDK, which you may download from:

http://www.eclipse.org/downloads/index.php

Using both SWT and Excelsior JET, you may significantly reduce the size
of the installation package of your Java GUI applications. Specifically,
if your application uses SWT but does not use AWT/Swing, Excelsior JET,
Professional Edition enables you to compile it into an executable that
does not require JRE at all. As a result, your installation package
includes only the following components:

- your application executable
- SWT native methods DLL (swt-win32-xxxx.dll)
- a subset of JET runtime (dynamic libraries)
- supplementary files (manuals, samples, etc.)

Figures in Section 5 below show that the size of a complete installation
package for a simple SWT application is about 4 megabytes.
Moreover, it can be further reduced with the help of JetPerfect Global
Optimizer.

To recap, SWT and Excelsior JET helps you get quite a reasonable download
size for your appication, not to mention superior performance and code
protection inherent to ahead-of-time native code compilation.

2. About this sample
--------------------

This sample relies on a small SWT-based program that draws the Mandelbrodt set.
The following files are inclided:

buildjar.bat script to create MandSet.jar
runjar.bat script to run MandSet on a JVM

buildexe.bat script to transform MandSet.jar to MandSet.exe

MandSet.java java source of the sample application
MandSet.ico icon file for the executable
MandSet.gif icon file for the title bar
MandSet.mf manifest file to convert MandSet.jar into so called
"executable jar". That's not a native executable - just
a wrapper with class files inside

_MandSet.prj Excelsior JET project file (generic, needs tuning)

3. How to build
---------------

Ensure that javac.exe and jc.exe are avalaible through PATH.
Suppose <ECLIPSE_HOME> is the Eclipse SDK installation directory.

Copy files

<ECLIPSE_HOME>\plugins\org.eclipse.swt\ws\win32\swt.jar
<ECLIPSE_HOME>\plugins\org.eclipse.swt\os\win32\x86\swt-win32-XXXX.dll

to the directory that contains this "readme" file. Note that XXXX encodes
an SWT version number, e.g. SWT 2.135 uses swt-win32-2135.dll.

Run buildjar.bat to create MandSet.jar that you may run by double
clicking or starting runjar.bat.

Now, tune the generic Excelsior JET project file as follows:

- Open _MandSet.prj in JET Control Panel.

- On the Classes Page, expand the "swt.jar" node (or the "org" node)
until the org.eclipse.swt.internal.awt (or org.eclipse.swt.awt in
newer versions of SWT) package node becomes visible.

- Right click on the org.eclipse.swt.internal.awt/org.eclipse.swt.awt
node and uncheck "Force into the project". This manipulation removes
the AWT-SWT bridge from the compilation set, thus enabling
the resulting executable to run without a JRE.

- Select File/Save As..., type "MandSet.prj" and click Save.

- Close the JET Control Panel.

Run buildexe.bat to create MandSet.exe.

4. How to prepare installation
------------------------------

Run JetPackII, and select the New button on the splash screen.

Select New package type.

Add MandSet.exe and swt-win32-XXXX.dll to the package on the Files page.

Select "Do not use JRE" on the JRE page.

Select the locales that your application has to support on the JET RT page

Perform the Trial Run.

Select Excelsior Installer as Backend.

On the Misc page, fill in vendor information such as company, product and
version, and define shortcuts for the executable.

Create the installation package on the Finish page.

That's all, now you can deploy your application.

5. Package size figures
-----------------------

This example is a small program. It's a few kilobytes in size.
Let us compare sizes of installation packages:

MandSet.jar + swt.jar + swt-win32-xxxx.dll, zipped: 1.0 MB
requires a JRE to be pre-installed on enduser systems

The same plus JRE 1.3.1 without optional files, zipped: 6.8 MB
includes a JRE

MandSet compiled by JET, packaged by JetPackII: 3.6 MB
does not require a JRE

MandSet compiled by the JetPerfect Global Optimizer, zipped: 1.3 MB
does not require a JRE

---------

For more information about JetPerfect, see Chapter "JetPerfect global
optimizer" of JET User's Guide.

Also, check out the sample from ../JetPerfect

=============================================
谁有汉化的吗?




我有一点感想和初学者们同享(原创)

话题树型展开
人气 标题 作者 字数 发贴时间
9547 请问 Excelsior JET 怎样使用? ysonic 36 2005-06-14 14:28
8798 Re:请问 Excelsior JET 怎样使用? Jove 26 2005-06-14 15:41
8410 Re:请问 Excelsior JET 怎样使用? why 51 2005-06-14 16:52
11112 Re:请问 Excelsior JET 怎样使用? ysonic 5153 2005-06-14 21:18
9626 Re:请问 Excelsior JET 怎样使用? ljy0000 1454 2005-06-15 10:22
8525 Re:请问 Excelsior JET 怎样使用? ysonic 26 2005-06-15 12:41
9350 Re:请问 Excelsior JET 怎样使用? ljy0000 1666 2005-06-15 15:25
8884 Re:请问 Excelsior JET 怎样使用? ysonic 11 2005-06-15 21:24

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923