Hello Everyone,
I have set my JAVA_HOME variable as E:\Program Files\Java\jdk1.6.0_21(system variable)
When I try to compile a simple program(which is in a folder called myproj) with this command -- E:\myproj\javac Ex.java -- it compiles fine. But when I try to run to run it, I am getting this error:: xampl
Program is like this::
public class Ex{
public static void main(
String[] args){
System.out.println("hii");
}
}
E:\myproj>
java Ex
Exception in
thread "main" java.lang.NoClassDefFoundError: Ex
Caused by: java.lang.ClassNotFoundException: Ex
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: Ex. Program will exit.
Please help.
Regards,
Divya