Code Hungry
Code Hungry

Reputation: 4000

Java: “Could not find the main class. Program will exit”

I am getting Java: “Could not find the main class. Program will exit” when i am running compiled jar files.

What causes this error and how do I avoid it?

I am using Netbeans 6.9.1 IDE and java 1.6

Upvotes: 1

Views: 1652

Answers (1)

rsan
rsan

Reputation: 1887

Maybe your manifest is malformed. Usually the programmer dont deal with this files when using an IDE but maybe you found a bug.

Read this documentation:

http://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html

Take a deep look to "Setting an Application's Entry Point" section. Maybe that's the problem.

Upvotes: 1

Related Questions