views:

6719

answers:

4

Im trying to export a program in eclipse to a .jar file. To my project in I have added some pictures and pdf. When im exporting to jar file, it seems that only the main has ben compiled and exported. My will is to export everything to a jar file if its possible becaus then I want to convert it to an extrakteble file, like .exe-file.

But how?

+1  A: 
VonC
I love FatJar! Works great.
David
+4  A: 
Yuval A
Correct, assuming the necessary resources don't include other jar files.
seanhodges
Is that jar executable?
Pedro Henriques
In my project/program, Im using a database that is created when I shut down the program. So I cant pack the database file. When I follow you direction and try to start the jar-file I get the message: Failed to load Main-Class manifest attrebute from ..._path_...
Adis
@Pedro - yes, the JAR can be executable, in the next view in the wizard you can choose the main class.
Yuval A
+1  A: 

Go to file->export->JAR file, there you may select "Export generated class files and sources" and make sure that your project is selected, and all folder under there are also! Good luck!

A: 

One more option is WinRun4J. There is an Eclipse Plugin for WinRun4J that allows you to export your application as a single executable with necessary jars/classes embedded.

(full disclosure: I work on this project)

Peter Smith