-
No main class found
I am trying to run my program from Netbeans but am getting a window appear saying that there is no main class.
I read that the issue is from having no main method but I do have this.
My code is pretty simple:
Code:
import java.util.Scanner;
class PrintInput {
public static void main(String[] args) {
Scanner InputCheck = new Scanner(System.in);
System.out.println( InputCheck.nextLine() );
}
}
-
Re: No main class found
This sounds like a Netbeans issue. Can you compile and run your class from the command line? How many other classes do you have in your project? Have you set the properties of the project so it knows which class to run when you click the "run" command? If memory serves, you should be able to right click on your class and select run from there.