开发者

Java application installer for linux

How can I create a linux installer for java desktop application? for an instance if we want to install netbeans on ubuntu there is a download which is named as "netbeans-6.8-ml-java-linux.sh" so how can i create "mydes开发者_如何学Pythonktopapp-linux.sh" i have the properly working .jar file i want to distribute my java desktop app. Can anyone help me?


I recommend you to have a look at IzPack. IzPack is a one-stop solution for packaging, distributing and deploying applications.

It is fully cross-platform and generates a single installer. As such, it is an alternative to native solutions such as platform-specific installers and package managers.

There are many other alternatives, but IMO IzPack is as good as they get and is completely free. If your app targets only Unix/Linux hosts you might consider creating native packages like RPM, DEB, etc...


simple..

open the .sh file, type ..

java -jar myJar.jar

now doubleclick the .sh file to run ur application


On Linux/Unix, the *.sh suffix identifies a shell script. These scripts are simple text files, starting with the special #! notation on the first line, which specifies the shell that will run the commands in the file.

Like the netbeans-6.8-ml-java-linux.sh you mentioned, your script should start with #!/bin/sh to reference the Bourne shell.

As mentioned already by raj, a simple

java -jar myJar.jar

command could be the minimal contents to launch your app from the jar.

You can then make your launch script arbitrarily complex in order to deal with different locations of the java executable, handle insufficient permissions, providing nice help messages, etc. (again, have a look at netbeans-6.8-ml-java-linux.sh to see what I mean).


You should take a look at InstallJammer. Not only can it build a cross-distro installer that would be easy for newbies to use, it can also register itself with the native RPM or DEB package manager so that the user can uninstall through the common system.


Introduction to shell archives
http://linux.die.net/man/1/shar
http://www.rpmfind.net/linux/rpm2html/search.php?query=sharutils

This might work for you as well:

makeself - Make self-extractable archives on Unix

makeself.sh is a small shell script that generates a self-extractable tar.gz archive from a directory. The resulting file appears as a shell script (many of those have a .run suffix), and can be launched as is.

http://megastep.org/makeself/


In addition to makeself and the other tools mentioned in the thread, I suggest taking a look at my tool, BitRock InstallBuilder It is capable of creating self-contained executables that can be downloaded and launched but unlike some of the other tools do not require a self-extraction step. That means the installers start faster and no extra disk space is wasted. It is commercial, but reasonably priced (and we have significant discounts for solo developers and smaller companies)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜