I am using Netbeans to create a Java desktop application. Everything is fine inside Netbeans. But when I try to run the .jar file created in the dist folder of my project’s workspace, I get the following error: can not find or load main class.
I have recently upgraded to Java 1.7.0_03. Do you think this may be the reason? The new JDK is located inside glassfish and I don’t understand why?!
By the way when I build the same application in Mac OS X with Java 1.6 installed I don’t have any problems.
If you are running the jar file by double clicking it, then the error is that the manifest.mf file(usually in META-INF folder) need to have the main-class defined.
have a look at http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html
the part
else if you are running from command prompt, then