I create jar file in IDEA Build>Build Artifacts. But can't run it with java -jar jarname.jar
- Error: Could not find or load main class Hello
. MANIFEST.MF file is in the /resources/META-INF/ folder. And here is the launcher class:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
MANIFEST.MF:
Manifest-Version: 1.0
Main-Class: Hello
EDIT: Added artifacts setting screenshot