Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: export to an .jar file in eclipse

I'm trying to export a program in Eclipse to a jar file.

In my project I have added some pictures and PDF:s. When I'm exporting to jar file, it seems that only the main has been compiled and exported.

My will is to export everything to a jar file if it's possible, because then I want to convert it to an extraditable file, like .exe-file.

But how?

like image 648
Adis Avatar asked Jan 08 '09 11:01

Adis


People also ask

How do I create an executable jar file in Eclipse?

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.

What is a jar file in Eclipse?

The Jar File wizard can be used to export the content of a project into a jar file. To bring up the Jar File wizard − In the Package Explorer select the items that you want to export. If you want to export all the classes and resources in the project just select the project.


1 Answers

No need for external plugins. In the Export JAR dialog, make sure you select all the necessary resources you want to export. By default, there should be no problem exporting other resource files as well (pictures, configuration files, etc...), see screenshot below. JAR Export Dialog

like image 57
Yuval Adam Avatar answered Sep 23 '22 18:09

Yuval Adam