Installer / packer for Java application for Ubuntu and SuSE

I have a Java application that matches the collection of boxes I want to install on Ubuntu and SuSE. I want the installer to be able to check the JRE, register the file association and be able to load the website during installation.

I understand that Ubuntu and SuSE are based on different architectures, so is there a consistent way to do this?

Does anyone have any tips on using utilities or reading guides to help me achieve what I'm trying to do.

+6
java installer linux ubuntu suse
source share
6 answers

Distributing a deb and rpm for each platform will provide IMO with the best user experience and system integration (checking JRE dependency, registering file associations, etc.). For a debian-based distribution, see Pack Java applications for Ubuntu (slides are available here ). To build rpm , see Howto RPM or Development and Packaging Java Software for openSUSE .

If you do not want to create packages for each platform, I would suggest distributing the installer, for example, using IzPack.This tool allows you to generate a unique cross-platform installer, provides built-in integration , is highly customizable , covers uninstall, and installer generation can be easily included in automatic build (based on Ant or Maven). This is a really good tool. And it has serious links (Sun Microsystems, JBoss / RedHat, Scala language project, some ObjectWeb / OW2 projects, XWiki, etc.).

+9
source share

Try it out. This installer works with most Linux distributions.

Paste your jars into the .tar.gz archive. if you want to Create a menu entry in the "Programs" menu, create the file "YOUR PROGRAM.desktop" and put this script in it

 [Desktop Entry] Comment=YOUR COMMENT Name=YOUR PROGRAM #(Must same as .desktop file name) Exec=java -jar "(Path to Extracted folder)/myapp.jar" Terminal=false Type=Application Icon=(Path to Extracted folder)/myapp.png Categories=Development 

OK, now you can put it in the .tar.gz archive.

Now you need to create the file "install.sh" (the file name is not important, it also works without the -.sh extension)

Here is the code

 #!/bin/bash if which java >/dev/null; then< sudo tar xvfz YOUR PROGRAM.tar.gz -C /opt #(Path for Extract Files) mkdir ~/.local/share/applications sudo tar xvfz DESKTOP.tar.gz -C ~/.local/share/applications echo "Program installed.!" else echo "JRE Not Installed..!" fi read exit 

Bring all 3 files in one folder, then run the install.sh file (should be marked as executable)

I hope this will be useful to anyone.

+3
source share

If you do not want to alienate users, do everything you need to allow the user to manage your package using tools similar to this distribution (see Pascal Tiven's answer). For Ubuntu and SUSE, this means deb and rpm packages.

As a user, I get annoyed right away when I need to install packages with my installers.

+2
source share

Check out InstallJammer if you are looking for a GUI installer. Otherwise, you might consider creating a separate built-in installer for each platform. RPM in case of SuSE and DEB for Ubuntu. InstallJammer can provide you with a graphical interface, as well as register using the package manager on each of these systems, if you want.

+1
source share

You can use BitRock InstallBuilder , it allows you to create graphical installers GUI, RPM and DEB. It can do what you specify (file associations, launching web pages, etc.). It is commercial, but we have free licenses for open source projects and discounts for small companies.

+1
source share

I had the same need for packaging a Java application as in the debbian / Ubuntu archive, but did not find the right manual, so when I managed to create the deb archive, I wrote my manual .

Basically, I created a Bash script that organizes .class files, etc. in the file hierarchy ready for the .deb archive, it writes the executable script file to run the packaged program. desktop to process the GUI, and then run dpkg -build altogether. Also, an important step, run lintian -i in the .deb file to make sure that you adhere to all standards and policies.

0
source share

All Articles