我寫了下面的代碼:進口包名*不工作
然後我用下面的命令來編譯:
javac -d . test.java
它工作正常,但是當我試圖導入類「測試」使用「進口abc.def *」它不會導入測試類,代碼:生成
import abc.def.*;
public class checktest {
public static void main(String a[]) {
test t = new test();
}
}
以下錯誤:
D:\javaprograms>javac checktest.java
checktest.java:8: cannot access test
bad class file: .\test.java
file does not contain class test
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
test t = new test();
^
1 error
您需要將javac指向類文件(test.class,無論在哪裏生成)。 – justkt 2011-02-07 18:02:56
你可以提供我在這種情況下的javac的確切語法 – imran 2011-02-07 18:31:57