Fix JNI error has occurred, please check your installation and try again

Hijacked
1 min readJun 2, 2024

--

if you get error when working java with maven, maybe you meet this error `A JNI error has occurred, please check your installation and try again Exception in thread “main” java.lang.UnsupportedClassVersionError: com/security/DemoApplication has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java` bla bla bla.. to handle this problem is really easy, go to your pom.xml and add.

Note : change the version of source and target.

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

This error occurs, perhaps you have 2 JDK versions on your computer, and when you first compile Maven, you use JDK X, then you change the version in the Pom XML to Java version and change the JDK to Y. My assumption is that the error occurred because of this. The message point is Unsupported Class Version Error, just write a code like above at pom.xml.

--

--

Hijacked

seorang pemula yang ingin berbagi sedikit, dan ingin terus melihat luasnya khasanah ilmu.