如题,项目是使用maven的一个swing程序,想要打包成jar运行。自己的思路是新建一个artifacts,然后build这个artifacts即可。但是按照这种方式打包之后双击提示:
学习是最好的投资!
The reason for this should be that Main-Class is not specified in the manifest. Either write a bat script and call the jar command to specify it, or use jar to specify it when building gradle
jar { from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } exclude 'META-INF/MANIFEST.MF' exclude 'META-INF/LICENSE' exclude 'META-INF/*.SF' exclude 'META-INF/*.DSA' exclude 'META-INF/*.RSA' manifest { attributes "Implementation-Title": "..." attributes "Implementation-Version": version attributes "Main-Class": "..." } }
Use jar task packaging in gradle
The reason for this should be that Main-Class is not specified in the manifest. Either write a bat script and call the jar command to specify it, or use jar to specify it when building gradle
Use jar task packaging in gradle