나는 다음과 같은 코드를 작성했습니다 작동하지 :. 내가 컴파일 명령에 따라 사용 후수입 패키지 이름 *
package abc.def;
public class test {
public void test() {}
public void disp() {
System.out.println("in disp");
}
}
을 :
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
이 경우에 javac의 정확한 구문을 제공 할 수 있습니까 – imran