开发者

Making excutable jar file using eclipse

开发者 https://www.devze.com 2023-02-13 16:59 出处:网络
My project runs fine from Eclipse. But when I tried to make it into a jar file or executable file it doesn\'t work.

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 com开发者_StackOverflowpile 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?


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消