The project has the following file structure: file structure
build.gradle:
...
jar {
baseName = 'billiard-viewer'
manifest.attributes 'Main-Class': 'billiards.viewer.Main'
//manifest.attributes 'Main-Class': 'fake_main'
}
sourceSets {
main {
java {
srcDir 'src/java'
}
}
}
...
And the artifact was set up as: Artifacts Setting
When I build and run the program in Intellij, it works perfectly. However, when I try to build it into a standalone JAR program, it keeps giving me Error: Could not find or load main class fake_main
.
Could anyone give me some ideas about what could be the reason behind this and how I can solve it?