“Could not find the main class” error when running jar exported by Eclipse

Verify that you can start your application like that:

java -cp myjarfile.jar snake.Controller

I just read when I double click on it – this sounds like a configuration issue with your operating system. You’re double-clicking the file on a windows explorer window? Try to run it from a console/terminal with the command

java -jar myjarfile.jar

Further Reading

  • Running JAR file on Windows

The manifest has to end with a new line. Please check your file, a missing new line will cause trouble.

Leave a Comment

tech