我写了下面的代码:进口包名*不工作
然后我用下面的命令来编译:
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