Results 1 to 2 of 2
Thread: No main class found
- 10-17-2012, 12:32 AM #1
Senior Member
- Join Date
- Jul 2012
- Posts
- 245
- Rep Power
- 8
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:
Java Code:import java.util.Scanner; class PrintInput { public static void main(String[] args) { Scanner InputCheck = new Scanner(System.in); System.out.println( InputCheck.nextLine() ); } }
- 10-17-2012, 02:46 AM #2
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.
Similar Threads
-
Main Method not found in class
By HinaKhan in forum New To JavaReplies: 6Last Post: 06-22-2012, 03:34 PM -
main method not found in class
By eLancaster in forum New To JavaReplies: 5Last Post: 02-09-2011, 09:48 AM -
Main Class not found
By Draugnar in forum New To JavaReplies: 3Last Post: 01-09-2010, 04:12 AM -
main class not found
By abhijit in forum NetworkingReplies: 3Last Post: 10-01-2009, 10:05 AM -
No main class found error
By jhering1986 in forum New To JavaReplies: 17Last Post: 03-28-2009, 03:34 AM
Bookmarks