Javatpoint Logo

91-9990449935

 0120-4256464


Error in running a program

By: krishkar552@gmail.com On: Mon Jun 13 16:22:08 IST 2016     0 0 0  0
I am trying to run a 'hello world' program. Compilation was successful. But when I write java <class name> and hit enter, it is showing error as follows.
Error: Could not find or load main class Simple.java.
I had set the path and class path . How to solve this error?
0

 
pls. write as below.

class A{
public static void main(String [] args){
System.out.print("Hello");
}
}

NOW SAVE THIS TO ANY DIRECTORY THAT YOU WANT TO SAVE, AND GO TO "cmd", and compile the program

compile the program-javac A.java

to run- java A

hope it will work for you, if problem still occurred pls. share the screen shot




0

By: pant8g@gmail.com On: Wed Jun 15 14:56:47 IST 2016 0 0 0 0
Are You Satisfied :0Yes0No


PLEASE REPLY

Please login first to post reply. Login please!