[오류 해결] 스프링 에러 처리 방법 - "has been compiled by a more recent version of the Java Runtime"

노이즈믹·2023년 8월 5일
0

오류 해결

목록 보기
1/1
post-thumbnail

문제

프로젝트를 깃에서 연동시키고 노트북에서 수행하려던 중, 에러가 발생했다.

가장 먼저 component-scan.xml에 들어가서 오류 상황을 확인했다.


Error occured processing XML 'org/springframework/web/bind/annotation/RequestMapping has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions
up to 55.0'. See Error Log for more details

원인

Java에서 외부 프로젝트를 Import 할 때, Library version이 맞지 않을 경우 발생하는 오류이다.

해결책

  1. Project 폴더에서 Properties 클릭

  2. Java Build Path 선택

  3. 기존 JRE System Library / JavaSe-1.8 삭제 후 Add Library

  4. JRE System Library 선택

  5. Execution environment > 리스트 박스에서 본인 환경에 맞는 jre 선택 > Finish > Apply and close

  6. 오류가 해결되었다면 JRE System Library 가 추가되고 X표시와 각종 빨간줄이 사라진다.

profile
개발 공부 블로그

1개의 댓글

comment-user-thumbnail
2023년 8월 5일

좋은 정보 얻어갑니다, 감사합니다.

답글 달기