---------------------------------------
Overview
JSmooth is a Java Executable Wrapper (in other words, it "converts" Java to exe).
It builds standard Windows executable binaries (.exe) that launch java applications. Such binaries contain all the information needed to launch your java application, i.e. the classpath, the java properties, the jvm version required, and so on. If Java is not installed, it helps the users by displaying them a notice before launching automatically a browser to a web site where they can download a JVM.
Features
Smooth User Experience
- Your users see and use a standard windows Exe binary. No more technical explanation on .jar, on javaw association, etc.
- The Jsmooth EXE are smart: if no VM is found, your users are nicely explained how to install Java and/or are redirected to a web site (depending on the selected wrapper).
Flexible automatic Java VM detection
- Detects the location of any Sun JVM installed. The wrappers use several strategies to detect all the JVM available on a computer, using windows registry, environment variables, windows path.
- Detects and uses Microsoft's JView (for 1.0 and 1.1 Java applications), if available.
- The JVM search sequence is fully customizable using the GUI.
- If a JVM is bundled with your software, you can force the wrappers to use it.
- Specify which versions of the JVM are compatible with your software.
Graphical User Interface
- A Swing-based project editor allows you to easily configure the executable binary for your software.
- Associate an icon to your executable, using a .ICO, .PNG, or .GIF file (automatic color reduction is done if necessary).
Application configuration
- Easy java properties configuration: specify the tag=value pairs you want the wrappers to pass to your java application.
- System environment variable are available in the java properties definition: just use the standard Windows %VARIABLE% syntax in your properties definition.
- Pass special variables that are not available to Java program, such as the executable path and name, and even the computer name.
- Specify all the classpath configuration, adding .jar, .zip, or directories, with an intuitive GUI.
- Want to modify the current directory used by your Java application? The wrappers will handle this for you.
Wrappers
- Provided with several exe wrappers skeletons, so that you can choose the one that best suits your needs!
- Use one of the provided wrapper or create your own, and plug-it seamlessly into the jsmooth framework.
/*****************************************************************************/
昨天要把一个用java写好的小的application打包成一个exe,去网上搜索了一下,都推荐说用jsmooth比较好,就去下载了一个来使用,下载地址是到http://jsmooth.sourceforge.net/index.php。
安装后运行JSmoothGen,界面如下:
使用介绍:
1.Skeleton Chooser下拉框中选择Windowed Wrapper
2.Skeleton Properties : 在launch java app in the exe process 选项打勾
3. 点击Executable, 这一步是设置生成的exe文件的属性,包括名字,图标,路径
4. 设置完成后,继续下一选项,Application
5.Main class : 主运行类,有main()方法的类
6.Embedded jar : 就是选择你要制作成EXE文件的jar
7.其他的选项如果不需要可不必设置,最后单击project下的compile 会生成一个文件,再单击run就可以在你刚刚设定好的路径下生成你要的exe文件了。
/******************************************************************************
1. 用JBuilder打包
file->new->点击Build->双击右边的Native Executable Builder->点击ok
就可以了.
2.0用exe4j也可以.
现在控制台把class文件打包:
jar cvfm 打包后的文件名.jar manifest.mf 要大包的class文件名 其他文件名
其中可以用*.class表示所有的class文件(也可以不用class文件名,而是文件夹的名)
其中manifest.mf必须放在当前目录下,他的内容是:
Manifest-Version: 1.0
Created-By: 1.5.0_07 (Sun Microsystems Inc.)
Main-Class: JavaTest
其中Main-Class是你的main方法所在的类的类名,不要后缀.
之后在用exe4j打包,就没任何问题了