오류 메시지

Exception in thread "main" java.lang.UnsupportedClassVersionError
: hello/hellospring/HelloSpringApplication has been compiled by a more recent version of the Java Runtime 
(class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

클래스 파일은 55.0.버전으로 컴파일 되었지만, 현재 컴파일러 52.0 버전이라서 로딩이 불가능

 

해결책

 

[intellj]

Project SDK 버전 변경 : Project Settings - Modules SDK => 11

Java Compiler 버전 변경 : Preferences - Java Compiler => 11

 

[환경 변수]

환경 변수 편집 : 해당 버전의 bin이 존재하는 폴더까지의 경로 추가

ex) C:\Users\~\.jdks\corretto-11.0.15

시스템 변수 편집

: JAVA_HOME -  C:\Users\~\.jdks\corretto-11.0.15

 

[JAVA]

cmd : java -version 확인으로 사용을 원하는 버전의 파일이 맞는지 확인

-> java8이 사용되고 있어서 jdk-18을 다운 받아서 로컬 컴퓨터에서 동작하는 버전의 변경을 진행

'Spring > error' 카테고리의 다른 글

Spring Boot 기초 오류  (0) 2023.03.06
Security 사용하는 페이지 접근 오류  (0) 2023.03.06

+ Recent posts