How to setup Main class in manifest file in jar produced by NetBeans project

前端 未结 10 1826
我在风中等你
我在风中等你 2020-11-29 10:25

I have the following problem. I have a Java project in my NetBeans IDE 6.8. When I compile it and it produces a .jar file containing everything possible, the META-INF is not

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-29 10:41

    I read and read and read to figure out why I was getting a class not found error, it turns out the manifest.mf had an error in the line:

    Main-Class: com.example.MainClass
    

    I fixed the error by going to Project Properties dialog (right-click Project Files), then Run and Main Class and corrected whatever Netbeans decided to put here. Netbean inserted the project name instead of the class name. No idea why. Probably inebriated on muratina...

提交回复
热议问题