Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making excutable jar file using eclipse

Tags:

java

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?

like image 382
Ahmed.Ibrahem Avatar asked Mar 04 '26 04:03

Ahmed.Ibrahem


1 Answers

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

like image 194
asgs Avatar answered Mar 05 '26 17:03

asgs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!