尝试更改清单属性,例如:
jar { manifest { attributes( 'Class-Path': configurations.compile.collect { it.getName() }.join(' '), 'Main-Class': 'hello.HelloWorld' ) }}然后只需更改
'hello.helloWorld'为
'<your packagename>.<the name of your Mainclass>'(您的Main类具有main方法)。在这种情况下,您可以在清单中创建一个指向此类的属性,然后运行一个jar。



