IT/개발
이클립스 The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files 에러
ihee
2016. 10. 7. 00:30
인수인계 받아 이클립스(STS)를 실행하니 첫줄부터 아래와 같이 에러가 발생한다.
Multiple markers at this line
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
eclipse가 설치된 JDK를 인식하지 못해서 발생하는것 같다.
이럴때는 아래와 같이 진행한다.
이클립스 메뉴 'Project -> Properties' 를 클릭하여 Properties 창에서 왼쪽의 'Java Build Path'를 선택하고 오른쪽에서 Libraries 탭을 클릭한다.
① 'Add Library....'를 클릭하고 나온 대화창에서
② 'JRE System Library'를 선택한 후
③ 'Next >'를 누른다.
다음으로 아래를 따라한다.
① 'Alternate JRE'를 선택하고
② 'Installed JREs...' 버튼을 눌러(위 캡쳐 참고)
③ 설치된 JDK 폴더 내의 JRE를 바르게 선택해 준다.
④ 선택이 끝나면 OK를 클릭한다.
이후 빌드를 자동이든 수동이든 실행하면 아래와 같이 깔끔하게 에러가 사라진다.
굳.