Sunday 8 September 2013

NetBeans on Mac : Unable to run different main class in Java project

NetBeans on Mac : Unable to run different main class in Java project

I created a new Java (application) project in NetBeans. Specified a main
class and ran it successfully.
I added another Java class to this project but in the default package.
Using Project --> Properties --> Run, I changed the main class to this
second class.
Now when I run the project in the IDE, it just keeps running forever. But
when I run the generated jar from the shell with java -jar project.jar, it
runs properly with the second class.
My platform : NetBeans 7.3 on Mac OS X 10.8.
Thanks.

No comments:

Post a Comment