troubleshooting Question

Jar file gives error message "Could not find the main class. Program will exit" on first try, works on second run

Avatar of Stian_B
Stian_B asked on
Editors IDEsJava
13 Comments1 Solution934 ViewsLast Modified:
Hi all,

I've created a java application that should be deployed. However, on every deployment, when i first run the jar file, i get this error:

"Could not find the main class. Program will exit".

When i run the file again, it works, and it works every time after that..

I'm using netbeans, and the Main Class under project properties are set to "project".Main, which is the correct class. Does anyone have a suggestion?

Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros