Ahmed.Ibrahem
Ahmed.Ibrahem

Reputation: 63

Making excutable jar file using eclipse

My project runs fine from Eclipse.

But when I tried to make it into a jar file or executable file it doesn't work.

I used the option "Export-Runnable JAR file"

The following message appears just after the eclipse finished the exporting process

JAR export finished with wornings , see details.

the details were ..

Exported with compile warnings:Mario/src/Map.java

and the same for other classes like

Exported with compile warnings:Mario/src/Player.java

and so on.

So that I used the other option "Export - JAR file"

It works fine and nothing appears while exporting it from Eclipse.

But when I try to open the file it gives me

Couldn't find the main class:Frame.Program will exit

Somebody have any idea about what the problem is?

Upvotes: 3

Views: 2343

Answers (2)

anergy
anergy

Reputation: 1384

The important thing for executable jar is Manifest. Make sure it exists and points to the correct class with main method

Upvotes: 4

asgs
asgs

Reputation: 3984

Your MANIFEST.MF file inside the META-INF dir should have a Main-Class attribute pointing to your main class.

Upvotes: 4

Related Questions