I have written a simple
Java code.It is compiling without any error but when i am running in using java command it is throwing an Exceptin.The Code is:
public class Simple
{
public static void main(
String[] args)
{
System.out.println("Hi i am a Simple class");
}
}
I am running code like this
C:\javaxcomm>java Simple
Exception in
thread "main" java.lang.NoClassDefFoundError: Simple
Caused by: java.lang.ClassNotFoundException: Simple
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Error: Could not find the main class.
Error: A JNI error has occurred, please check your installation and try again
Still Simple.class is generating at my c:
what will be the reason???Please help