Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make program able to install

I have finished developing my java application using netbeans. Now I want to give it to others. How can I change it so that user can directly install and run my application without having to run it from IDE or command line.

Thank you

like image 202
samsri Avatar asked May 31 '12 11:05

samsri


2 Answers

You have a few options:

  1. If "install" means an icon to click on and run your app, you can create an installer to do so. You don't specify your target operating system. I'd recommend Googling for installers like Wise.
  2. You can create an executable JAR with a launch command file for users to execute.
  3. You can use Java Web Start.

You'll have to assume that your user base has a JVM of the correct version installed and available for your app to use.

You don't say anything about databases or other services, so I'll assume that you have a main method that you want to launch.

like image 173
duffymo Avatar answered Oct 04 '22 11:10

duffymo


For a simple application with no dependencies, the easy way is to create an executable JAR file.

For a complicated application, you need to package up the primary JAR and the other things that it depends on, and present that in a way that the user can install. This might be a simple ZIP file (or equivalent) for the user to unzip. (That is the way that Eclipse and is distributed for example). Alternatively, it might be a fancy installer ... which you would need to write or generate. (There are a variety of installer generators out there: some free / open source, others commercial.)

Basically, you need to balance "ease of installation" for the user against the amount of effort (and money) you are prepared to spend on creating installer infrastructure for your application.

Alternatively, if you are prepared for the application to be hosted on and launched from a web server, then Java WebStart is a good alternative to an installer, not least because it removes the need to get the user to reinstall to pick up newer versions of your application.

like image 24
Stephen C Avatar answered Oct 04 '22 11:10

Stephen C