Nick Anderegg
Nick Anderegg

Reputation: 1016

How to distribute Java-based software?

Now, don't get me wrong, I am a very competent programmer, but when I program, I typically develop things for the web using scripting languages like JavaScript, PHP, Python, SQL, etc. If I want to develop Java software (I am relatively experienced in Java), how do I distribute it?

Is there any good way to package up Java software in a nice little executable, send it out, and have it run? Alternatively, is there any good way to package up Java in some sort of installer, and send it out to be installed and run?

Upvotes: 2

Views: 2446

Answers (9)

Muhammad Imran Tariq
Muhammad Imran Tariq

Reputation: 23352

Hello you can make an installer for your application.

In the link below you will find a nice help about izpack installer.

http://www.imrantariq.com/blog/?p=89

Link below contains a detailed pdf to make installer with izpack.

http://www.imrantariq.com/blog/?attachment_id=112

cheers

Upvotes: 1

Michael Berry
Michael Berry

Reputation: 72254

I personally like izpack. It generates a jar file installer that you could wrap up in launch4j, supports things like windows specific shortcuts, is highly customisable through XML and hooks directly into ant.

OneJar is great for smaller stuff, but for larger programs or applications it's nowhere near as flexible and in my experience is rather slow.

Upvotes: 1

Knubo
Knubo

Reputation: 8443

You can also consider use one of the rich client platforms available for Java. The learning curve is probably a lot higher than just creating a jar file and ship it, but you will get a lot for free when it comes to distribution. (Think Eclipse with auto update through an update site).

Do a search for "Eclipse RCP" and "Netbeans RCP" and you'll find the two biggest contenders here. I also performed a serach for "eclipse RCP installer" and one of the hits seems interesting:

http://download.instantiations.com/RCPPackagerDoc/integration/latest/docs/html/gettingstarted/GenInstaller.html

Upvotes: 1

Costis Aivalis
Costis Aivalis

Reputation: 13728

Here you will find a large set of options: Open Source Installers Generators in Java
It is very useful for the "naive" customer or user of your application, to make the installation process as painless as possible. Let them install whatever is needed, DBMS, JVM, JMF and additional options via one installer.

Upvotes: 1

technomage
technomage

Reputation: 525

I'm using Launch4J http://launch4j.sourceforge.net/ it will generate an .exe executable for Windows, if the targeted system don't have JVM, it will tell user to download and get JVM.

Upvotes: 4

I have found two approaches to work well, depending on the needs of the end user.

1) Java WebStart - allows for central distribution and easy maintenance, but works best for online users. Require you to have a web site to locate the files - these days this is easy to do on the Google Application Engine.

2) Wrapping up the Java program in a single jar using one-jar, and then using jsmooth to generate an .EXE file which ensures Java is available, extracts the jar-file and invokes Java on it. This works well for users not always on the net, where you want the launch process to be transparent, but is less easy to upgrade than the webstart approach.

Upvotes: 3

christophmccann
christophmccann

Reputation: 4211

I use Maven to handle all the dependencies of my projects and that way when you utilise Maven to build your projects they will compile into one nice executable jar that contains everything so you dont need to worry about getting all your third-party jars in the right place etc.

Upvotes: 2

limc
limc

Reputation: 40160

There are a couple of ways: one is to create an installer that allows your user to install and run it. For this you can take a look at NSIS.... or you can just use Java Web Start where your user can just click the link and launch your application.

Upvotes: 1

aioobe
aioobe

Reputation: 420921

You can package Java applications in so called jar-files using the jar tool or any competent Java IDE. These jar-files are self-contained and seldom need any installer.

These .jar files can easily be distributed and executed.

If you're used to web-development, you may also be interested in the Java Webstart technology.

Some links to get you started.

Upvotes: 3

Related Questions