Junit에 속한 패키지 (내 org.junit, org.junit.experimental.results, org.junit.internal, org.junit.internal.matchers, org.junit.matchers, org.junit.rules
)의 프로젝트에서 컴파일 오류가 발생했습니다.Java/Junit 4를 사용하면 컴파일 오류가 발생합니다.
이 모든 클래스는 내 프로젝트에서 다음과 같은 의미로 사용됩니다. Security/src/org.junit, Security/src/org.junit.experimental.results
, 여기서 Security
은 내 프로젝트의 이름입니다. 내가 쓴 내 수업은 내가 정의하는 다른 패키지 아래에 있습니다 : 모든 클래스에서 Security/src/myPackage/myClass
, 그것은 예를 들어, 가져 오기 라인에 complation 오류를 제공합니다
import org.hamcrest.Description cannot be resolved
import org.hamcrest.Matcher cannot be resolved;
import static org.junit.matchers.JUnitMatchers.containsString cannot be resolved;
수표 확인합니다 (가고있다 녹색/빨간색 막대가 표시되고 올바른 결과를 제공함)이 문제는 모든 프로젝트에서 오류를 발생시킵니다.
처음에는 junit-4.10.jar 만 가져옵니다. 그러나'import org.junit을 해결할 수 없다 ','import junit을 해결할 수 없다'라고 씁니다. 이를 위해 junit-dep-4.10.jar을 설치하면 이러한 문제를 해결할 수 있습니다. –