Error: A JNI error has occurred, please check your installation and try again

Jeongyun Heo·2022년 1월 21일
0

터미널에서 클래스파일 실행하니까 에러

Error: A JNI error has occurred, please check your installation and try again

java.lang.UnsupportedClassVersionError: com/eomcs/lang/ex01/Exam0300 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 52.0

이클립스 컴파일러 JDK 버전이 더 높아서 에러 발생
이클립스 컴파일러 JDK 버전이랑 터미널 JDK 버전이랑 달라서 그런 거 같다

이클립스 컴파일러 버전

이클립스와 동일한 버전의 JDK를 설치해준다

JDK설치
$ sdk install java 17.0.1-zulu

설치가 다 되면 이 버전을 기본으로 설정할 거냐고 물어본다.
Do you want java 17.0.1-zulu to be set as default? (Y/n): y

이제 잘 된다ㅎㅎ

0개의 댓글