user224790
user224790

Reputation: 209

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 "mydesktopapp-linux.sh" i have the properly working .jar file i want to distribute my java desktop app. Can anyone help me?

Upvotes: 5

Views: 11336

Answers (6)

Daniel Lopez
Daniel Lopez

Reputation: 3391

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)

Upvotes: 0

Dmitry Yudakov
Dmitry Yudakov

Reputation: 15734

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/

Upvotes: 0

Damon
Damon

Reputation: 258

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.

Upvotes: 0

Rahel Lüthy
Rahel Lüthy

Reputation: 7007

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).

Upvotes: 0

Bozhidar Batsov
Bozhidar Batsov

Reputation: 56595

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...

Upvotes: 6

raj
raj

Reputation: 3811

simple..

open the .sh file, type ..

java -jar myJar.jar

now doubleclick the .sh file to run ur application

Upvotes: 1

Related Questions