Exception in thread "main" java.lang.NoClassDefFoundError:
I go this Class located in /root/com/one
package com.one;
publicclass Add
{
publicint add(int x,int y)
{
int result =x+y;
return result;
}
}
When i am trying to compile Test class ; Located /root/Desktop
import com.one.Add;
publicclass Test
{
publicstaticvoid main(String args[])
{
Add obj =new Add();
System.out.println(obj.add(4,6));
}
}
With this command (i am currently in /root/Desktop)
javac -classpath .:/root Test.java
it compile, but when i try to run it : java Test
i got this error
Exception in thread "main" java.lang.NoClassDefFoundError: com/one/Add
at Test.main(Test.java:13)
Any idea what i am doing wrong
Message was edited by:
AQ_Java

