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"





public class HelloNetBeans {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Hello World! from NetBeans.");
}
}

public class helloworld{
public static void main(String[] args){
System.out.println("Hello World!");
}
}
