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?
Asked
Active
Viewed 7.8k times
13
-
which IDE are you using? – 4aRk Kn1gh7 Aug 04 '14 at 07:59
-
I use eclipse kepler version. – user3766188 Aug 04 '14 at 08:05
2 Answers
16
To create a new runnable JAR file in the workbench:
- From the menu bar's File menu, select Export.
- Expand the Java node and select Runnable JAR file. Click Next.
- In the Runnable JAR File Specification page, select a 'Java Application' launch configuration to use to create a runnable JAR.
- In the Export destination field, either type or click Browse to select a location for the JAR file.
- Select an appropriate library handling strategy.
- Optionally, you can also create an ANT script to quickly regenerate a previously created runnable JAR file.
4aRk Kn1gh7
- 4,259
- 1
- 30
- 41
-
1Thank you. But I want to create an executable jar file from ubuntu command line(terminal). Because I want to use this executable jar file from other application. When I generate an executable jar file from eclipse there are no libraries files are included.That's why? – user3766188 Aug 04 '14 at 08:20
-
1The runnable jar export window in eclipse has a radio button where you can choose to package the required libraries into the jar. – 4aRk Kn1gh7 Aug 04 '14 at 10:51
-
3The `Launch Configuration` setting is blank, so there is nothing I can choose. What do I do? – Azurespot Jun 30 '18 at 00:43
-
1
2
Right click on project which one you want to create executable jar
-> Export -> Runnable jar
-> Select the Main class in "Launch Configuration" -> Export destination (your system path) -> Finish
Bhaskara Arani
- 1,556
- 1
- 26
- 44

