*(某个类名) has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0

问题描述

运行main方法,弹窗报错"A JNI error has occured, please check your installation and try again......"点击确定结束弹窗,所有弹窗结束后,控制台打印了错误信息:"*(某个类名) has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0"

 

 

解决办法

思路为配置中jdk版本和java compiler版本是否一致,反正一致没问题。这个项目用了Java15, Java Compiler调成15.这个项目用了Java8, Java Compiler调成1.8。

1.检查配置的jdk的版本,以及是否正确地配置了jdk。

2.选中项目,右键,propereties, Java Complier调整Compiler compliance level。

 

 扩展

1

我认为通过window -> compiler可以设置以后所有项目的java compiler版本。

 

 2

新建项目的时候也能设置

 

 

posted @ 2022-07-25 14:30  莫提默  阅读(4557)  评论(0编辑  收藏  举报