i have java file One.java in Test directory and i am comipiling this file as java Test.One as my present working directory as c:\Test but its throwing error.Can anybody please suggest. And even tried java -classpath . Test.One, then also same problem.
Welcome to JavaRanch. NoClassDefFoundError (almost) always means that your classpath is not set correctly.
i have java file One.java in Test directory and i am comipiling this file as java Test.One
You mean, that's how you run (not compile) the class. Has One.java a package statement at the top of the source file, like this:
If that's the case, then you need to add the parent directory of the directory named Test to the classpath. Since directory Test is in the root directory, try this: