When you create a gradle project, output a jar and run java -jar ***. Jar
***. Jar does not have the main manifest attribute
.
Specify the main class to solve this.
plugins {
id 'java'
}
group 'xyz.miyayu'//Depends on the environment
version '1.0-SNAPSHOT'//Depends on the environment
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
}
//~ Abbreviation ~
version '1.0-SNAPSHOT'
//to add
jar{
manifest{
attributes 'Main-Class' : 'xyz.miyayu.hogehogeProject.MainClass'//Specify the class name
}
}
//Add up to here
repositories {
//~ Abbreviation ~
Thank you for your hard work.
Recommended Posts