I am using NetBeans to build my executable JAR and haven’t messed around with any Ant or project settings (using defaults).
When I go to Run >> Clean and Build Project, I see NetBeans building my JAR and putting it into my project’s dist/ directory without a hitch.
When I double-click that JAR to run it, I get the following error message:
Could not find the main class: com.me.myorg.MainApp. Program will exit.
If I open up the JAR in WinRAR and extract the META-INF/MANIFEST.MF file, I see the following attribute defined:
Main-Class: com.me.myorg.MainApp
Obviously, com.me.myorg.MainApp is the “head” of my GUI (Swing) app.
Any ideas as to what is going on? How to troubleshoot? Thanks in advance.
Try in command prompt(Windows):
EDIT
Run the command prompt like this: Go to Start and in the Search box type CMD. Right click the Command Prompt icon and choose Run as Administrator.
http://www.howtogeek.com/howto/windows-vista/run-a-command-as-administrator-from-the-windows-vista-run-box/
Then run the command above.