Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create executable Jar file under Eclipse

Tags:

java

eclipse

I created a Java application and I want to create jar file for this application. This application imported other external jar files by Build Path>Add External Jar File. How can I generate executable JAR file for this application in Ubuntu with these external libraries dependencies?

like image 708
user3766188 Avatar asked Aug 04 '14 07:08

user3766188


People also ask

How do I create an executable JAR file in Eclipse?

To export your project, right-click it and select Export. Select Java > Runnable JAR file as the export destination and click Next. On the next page, specify the name and path of the JAR file to create and select the Launch configuration that includes the project name and the name of the test class.

How do I create an executable Java project in Eclipse?

While Eclipse doesn't have the ability to export a Java project as an ".exe" file, you can export it as a runnable JAR (. jar) file, which works similar to an executable (.exe) file. You can then use a program called Launch4j to convert the JAR file to an executable file.


1 Answers

To create a new runnable JAR file in the workbench:

  1. From the menu bar's File menu, select Export.
  2. Expand the Java node and select Runnable JAR file. Click Next.
  3. In the Runnable JAR File Specification page, select a 'Java Application' launch configuration to use to create a runnable JAR.
  4. In the Export destination field, either type or click Browse to select a location for the JAR file.
  5. Select an appropriate library handling strategy.
  6. Optionally, you can also create an ANT script to quickly regenerate a previously created runnable JAR file.
like image 178
4aRk Kn1gh7 Avatar answered Oct 02 '22 08:10

4aRk Kn1gh7