简体   繁体   English

如何将jar文件转换为exe和rpm

[英]How to convert jar files into exe & rpm

I have the following jar files for my app: 我的应用程序有以下jar文件:

DesktopApplication1.jar DesktopApplication1.jar

Plus , i have used the some extra API's for my app , like jsoup, jexcelapi etc. There are about 7 api's in the lib folder. 另外,我已经为我的应用程序使用了一些额外的API,比如jsoup,jexcelapi等。在lib文件夹中有大约7个api。

How to make a EXE file & RPM file out of all these jar files? 如何从所有这些jar文件中制作EXE文件和RPM文件?

PS I am a first timer. PS我是第一个计时器。 So take that into consideration.also, I have used Netbeans 6.8. 所以考虑到这一点。我也使用过Netbeans 6.8。 So the main API is in \\dist folder. 因此主API位于\\ dist文件夹中。 And the API used is in \\dist\\lib folder. 并且使用的API位于\\ dist \\ lib文件夹中。

thanks in Advance 提前致谢

使用jsmooth从jar制作exe

Build your JAR with fatJar to include all the dependencies in it, and then make it executable with your favorite tool (I use Launch4j ) 使用fatJar构建您的JAR以包含其中的所有依赖项,然后使用您喜欢的工具使其可执行(我使用Launch4j

RPM is little bit different, since it is not executable, but package format. RPM略有不同,因为它不是可执行的,而是包格式。 There are lots of tutorials, how you build it up. 有很多教程,你如何建立它。

You could make a BAT file a file with .bat(For windows) extension 您可以使用.bat(For Windows)扩展名创建一个BAT文件

Just open notepad and write the following text 只需打开记事本并写下以下文字即可

java -jar DesktopApplication1.jar

Save the file as filename.bat(the .bat extension is important) 将文件另存为filename.bat( .bat扩展名很重要)

Place the .jar and .bat files together and just double click the .bat file every time you need to run the jar... 将.jar和.bat文件放在一起,每次需要运行jar时双击.bat文件...

If you don't want to keep both together then give the absolute path of the jar in the .bat file 如果你不想将两者放在一起,那么在.bat文件中给出jar的绝对路径

java -jar AbsolutePath/DesktopApplication1.jar

For a linux machine make a file with ( .sh ) extension rest of the procedure is same... 对于一台linux机器,创建一个带有( .sh )扩展名的文件,其余的程序是相同的......

Try InstallJammer . 试试InstallJammer It provides what you want. 它提供了你想要的。

Deploy the app. 部署应用程序。 with Java Web Start . 使用Java Web Start JWS Can make it easy to add other Jars to the apps. JWS可以轻松地将其他Jars添加到应用程序中。 run-time class-path, avoiding the common problem with fat jar of violating the API's distribution license (when it says WTE 'you are allowed to distribute this in unaltered form..') and can provide the further benefit of only downloading the parts that the user requires (when the user requires them). 运行时类路径,避免了胖罐违反API分发许可证的常见问题(当它说WTE'你被允许以未改变的形式分发它'时)并且可以提供仅下载部件的进一步好处用户需要的(当用户需要时)。

JWS has many other cool features like desktop integration (menu bars, start menu item), splash screens, automatic updates, support by the owners of Java, and compatibility with any platform for which Java is available. JWS还有许多其他很酷的功能,如桌面集成(菜单栏,启动菜单项),启动屏幕,自动更新,Java所有者的支持,以及与Java可用的任何平台的兼容性。

For creating .exe to run on Windows: 要创建.exe以在Windows上运行:

  1. Download launch4j from http://launch4j.sourceforge.net . http://launch4j.sourceforge.net下载launch4j。
  2. build wrapper .exe through launch4j. 通过launch4j构建包装器.exe。
  3. Download innoSetup from http://www.jrsoftware.org/isdl.php . http://www.jrsoftware.org/isdl.php下载innoSetup。
  4. Build .exe as installer, the setup file, for user to download and install. 构建.exe作为安装程序,安装文件,供用户下载和安装。

I am working to create rpm. 我正在努力创建rpm。 Will share after making it working. 在工作之后会分享。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM