转 Java2Exe: 也许JSmooth更适合你

看到很多人问如何将Java程序转成EXE。最省事的方法莫过于用JBuilder,但是如果你觉得JBuilder太过于笨重,或者在出于种种原因不能用JBuilder, 看看下面的介绍,也许JSmooth,这个小巧、智能、遵循GPL的开放源码的工具能够帮助你。( http://jsmooth.sourceforge.net/)

 

---------------------------------------

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打包,就没任何问题了


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值