“Could not find main method from given launch configuration” when using Java+Scala+Slick2D

后端 未结 6 1611
清歌不尽
清歌不尽 2021-01-12 03:42

I\'ve got a project in which I\'m using Java+Scala+Slick2D.

The project itself runs well when launched from within eclipse. But when I try to make a jar file, it jus

6条回答
  •  感动是毒
    2021-01-12 04:07

    I had this problem with Eclipse version 2019-03 (4.11.0) and compiler JaveSE-11. Choosing the right launch configuration and exporting runnable jar failed over and over again with an error

    Could not find main method from given launch configuration

    I've tried to restart Eclipse and do a clean build, but it didn't help.

    In the end, I found a workaround to go into the generated jar file (I've used 7zip) and change META-INF/MANIFEST.MF file. The file should have something like this inside:

    Manifest-Version: 1.0
    Class-Path: .
    Main-Class: .
    

    Hope it helps someone.

提交回复
热议问题