使用autojar打包JRE,并使用jsmooth产生exe文件

1. 使用autojar对程序进行瘦身,并把jre打入包中(当前有一个没有解决的问题就是它会把一些必要的配置文件给干掉)
   java -jar autojar.jar -av -c dataswap-gui.jar -o myapp.jar -m GUI-MANIFEST.MF

2. 使用jsmooth把jar文件做成exe文件
   照着做, 很简单的, 关键一点就是选好图标就可以了,生成的文件如下:
   <?xml version="1.0" encoding="ISO-8859-1"?>
<jsmoothproject>
<JVMSearchPath>registry</JVMSearchPath>
<JVMSearchPath>javahome</JVMSearchPath>
<JVMSearchPath>jrepath</JVMSearchPath>
<JVMSearchPath>jdkpath</JVMSearchPath>
<JVMSearchPath>exepath</JVMSearchPath>
<JVMSearchPath>jview</JVMSearchPath>
<arguments></arguments>
<currentDirectory>${EXECUTABLEPATH}</currentDirectory>
<embeddedJar>true</embeddedJar>
<executableName>new-myapp.exe</executableName>
<iconLocation>E:\szdbpt\szsf\web\images\book.gif</iconLocation>
<initialMemoryHeap>-1</initialMemoryHeap>
<jarLocation>myapp.jar</jarLocation>
<mainClassName>com.gemt.dataswap.gui.MainInterface</mainClassName>
<maximumMemoryHeap>-1</maximumMemoryHeap>
<maximumVersion></maximumVersion>
<minimumVersion></minimumVersion>
<skeletonName>Windowed Wrapper</skeletonName>
<skeletonProperties>
<key>Message</key>
<value>Java has not been found on your computer. Do you want to download it?</value>
</skeletonProperties>
<skeletonProperties>
<key>URL</key>
<value>http://www.java.com</value>
</skeletonProperties>
<skeletonProperties>
<key>SingleProcess</key>
<value>0</value>
</skeletonProperties>
<skeletonProperties>
<key>SingleInstance</key>
<value>0</value>
</skeletonProperties>
<skeletonProperties>
<key>JniSmooth</key>
<value>0</value>
</skeletonProperties>
<skeletonProperties>
<key>Debug</key>
<value>0</value>
</skeletonProperties>
</jsmoothproject>

编译就可以产生exe文件呢!

你可能感兴趣的:(java,C++,c,Web,xml)