Java packaging tools - alternatives for jsmooth, launch4j, onejar

本秂侑毒 提交于 2019-11-28 04:42:46

Launch4j has just been updated ! http://launch4j.sourceforge.net/changelog.html

Did you check IzPack? This is a great piece of software to create cross-platform installers:

IzPack is an installers generator for the Java platform. It produces lightweight installers that can be run on any operating system where a Java virtual machine is available. Depending on the operating system, it can be launched by a double-click or a simple 'java -jar installer.jar' on a shell. The most common use is to distribute applications for the Java platform, but you can also use it for other kinds of projects. The main benefit of IzPack is that it provides a clean and unique way of distributing a project to users using different operating systems.

Some really famous companies and projects use it for many years (Sun Microsystems, JBoss/RedHat, the Scala language project, some ObjectWeb/OW2 projects, XWiki and many more). If it's good for them, it should be good for you :)

Since none of the answers were approved, and JavaFX 2.2 has not been mentioned above (was not available at the time of the answers) here goes:

JavaFX 2.2 (part of Java Runtime and SDK since 7u6) allows building native exe/dmg/rpm's that tag along the full RT component as well. I believe this is a valid answer to your need, as well as an officially supported solution from Oracle.

https://blogs.oracle.com/talkingjavadeployment/entry/native_packaging_for_javafx

Have you tried IzPack (http://izpack.org/)?

You can try

http://winrun4j.sourceforge.net/

Has an exe with 64bit support and is quite easy to configure with an ini file.

Maven 2 provides the ability to create a jar which contains all the dependencies as part of its assembly plugin. This combined with the jar plugin configuration of the manifest file (and specifically setting Main-class to the Class with main) is all you need to do basic packaging.

To some extent Java web start is now considered the better way to distribute Java applications and Maven 2's assembly capability combined with web start gets you everything you need without going via the exe route.

If you just want an exe (instead of a full-blown installer) you can make one with NSIS: http://nsis.sourceforge.net/Java_Launcher_with_automatic_JRE_installation

Yes, NSIS is an installer but you can have it just run a jar in the same directory by stripping out all of the installer stuff. Basically it works like launch4j but is a lot more configurable.

As I was fed up with recent security changes in Java Webstart, I created my own tool, JNDT. It's under GPL.

It goes farther than akauppi's suggestion because it allows to create GNU Linux packages even under Mac and Windows :) I use it to create Mac bundle under GNU Linux too. For the moment, it's just a single Ant library with a few dependencies that allows to create native self-contained application bundles for GNU Linux, Mac OS X and Windows. I use it for my first person shooter and I'm very happy with it. It bundles the JRE but it can use the system JRE if you want.

P.S: JNDT is able to create a native Windows installer as an executable with NSIS even under GNU Linux.

I understand that the GPL license discourages some developers to use my tool. In this case, rather use PackR.

If you are using gradle, there is a plugin that uses launch4j (under the hood) and works great. It doesn't even require you to download or install launch4j, it is totally automated.

https://github.com/TheBoegl/gradle-launch4j

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!