Tuesday, January 24, 2012

How to run NetBeans compiled program

Last article show how to create a Hello World program using NetBeans IDE 7.1, and also run it - inside NetBeans IDE. If you try to run it in command line using java (ex. java HelloNetBeans), may be you will be complaiined with Error of java.lang.NoClassDefFoundError. It should be a normal case.

Now, click Run -> Clean and Build Main Project in NetBeans IDE top menu. NetBeans' Output window will show you how to run it in command line. such as:
java -jar "C:\Users\erix7\Documents\NetBeansProjects\helloNetBeans\dist\helloNetBeans.jar"

NetBeans IDE Output show you How to run NetBeans compiled program
Run the generated jar using java in command line

No comments:

Post a Comment