I am in my root directory /work/vsubra. I have file A.java in this directory. When I compile useing javac A.java it does create a class in the same dir as A.class. But when I run it using java A then it gives me this error Exception in thread "main" java.lang.NoClassDefFound error i have given the path in my classpath also for rt.jar. The path goes as /usr/java131/jre/lib/rt.jar;. Why this error then?
Joined: Dec 28, 2002
Joined: Aug 26, 2001
the command line should be java -classpath . A Moving this to the Java in General (Beginner) forum.