Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Package and Deploy an Eclipse Java Application?

I have built a Java application that has some dependencies (~10). I would like to easily package this application up and deploy it as a single file to a CD or USB drive.

There doesn't seem to be any "nice" wizard to search the project, grab the dependencies and setup the classpath on the target computer. I have to do this manually.

Is there a better way? Something simple, easy and straight-forward. A link to a tutorial on this would be great.

Seems to me that this should be a built-in feature to eclipse. Deployment of a web application seems easy enough, but not a Java application.

like image 487
Rick Avatar asked Mar 31 '10 18:03

Rick


People also ask

How do I package a Java project in Eclipse?

Select the Project in the Project Explorer. Choose File >> New >> Package menu option to create a new Java package. Alternatively, Right-click on the project choose New >> Package from the context menu. Give a package name and click on the Finish button.

How do you package a Java application?

The recommended way to package Java applications is to use a collection of Ant tasks ( ant-javafx. jar ), which are provided with the JRE. NetBeans IDE uses these Ant tasks to package JavaFX and Java SE projects. Embedded packaging support in NetBeans IDE covers most of the typical use cases.

How do I deploy a project in Eclipse?

In Eclipse, select your application's project(s) and invoke the File->Export... menu item. In the Export wizard selector, select Java - Jar file and press the Next button. Select the files that are to be deployed, set the export destination to <yourApplication>/<yourApplication>.

How do I run a package in Eclipse?

Step 1: Open Eclipse and click File > New > Java Project. Step 2: Provide the Project Name and click on the Finish button. Step 3: In the Package Explorer (left-hand side of the window) select the project which you have created. Step 4: Right-click on the src folder, select New > Class from the submenu.


1 Answers

Have a look at the Fat Jar Plug-In.

like image 83
kgiannakakis Avatar answered Sep 18 '22 03:09

kgiannakakis