Does netbeans know where this main class is, it's a property of the project which it'll need to populate the manifest correctly when packaging it up into a jar.
When you run it from netbeans are you running the project or running the file?
Running the file works fine, but the project won't run.