This is my MainBot.java code:
public class MainBot {
public static void main(String[] args) {
new MainBot("my_private_token");
}
public MainBot(String token) {
// do stuff
}
}
I have the following problem: When I try to execute the .jar file generated by IntelliJ, I get the following error:
could not find or load main class: MainBot
But when I look in the .jar file using WinRAR, I see this:
The MainBot.class file is there! The manifest file in the META-INF/ folder looks like this:
Manifest-Version: 1.0
Main-Class: MainBot
And the the META-INF folder looks like this:
What did I do wrong? When exporting, I select the correct main file in INTELLIJ, add the META-INF directory to resources/ and then I build my artifact. How come that The MainBot file cannot be found, when it is there?! I also tried playing arond with the MAINFEST.MF file and tried changing the Main-Class to ../MainBot or something, but none of that worked.
EDIT: This is the artifact under Project Structure | Artifacts