I have a
java file , Test.java . It import some class in the test.jar . Now I put the command :
Javac –cp c:\..\test.jar c:\..\Test.java
Now I have compiled it successfully !
But when I use the java to use this class , like below :
Java –cp c:\..\test.jar
Test Then system output :
Exception in
thread "main" java.lang.NoClassDefFoundError: com/TestForPie
This is show that the command java can not find the Test.class . It’s sure that I have use command java and its arguments wrongly . how can use java to run my class ? And what’s wrong with me ?
Note : in my Test.java , I don’t use package to pack this java file in any packages .