Deploying a Java Program

I have a java application that I have created. Now I want to give it to my friend? How do I create a version of the deployment that they can run?

+2


a source to share


4 answers


The easiest for you is to export the program as a "Runnable JAR file". Then your friend does it from the command line:

java -jar MyApp.jar

      



Probably the easiest way for your friend is that you take the above jar file and deploy using WebStart . It is a cross platform. Your friend simply uses their web browser to navigate to the web page that hosts the app and clicks on the link.

+1


a source


Create a JAR file (it's in the export menu) and send it to them. JAR files contain all the classes in a Java application and a manifest that specifies things like the one that is the main class. If your application depends on other 3rdparty libraries, you need to include them as well; it is possible to link them in a JAR file, but this is non-trivial



0


a source


I think this one is what you are looking for. Basically, turn it into a self-executing jar and run it. It gets more complicated if you have other dependencies besides the standard API in Java.

0


a source


Create a jar file and put the following information in your manifest file

Manifest-Version: 1.0
Class-Path: lib.jar 
Main-Class: mypackage.MyClassWithMainMethod

      

0


a source







All Articles