Home > Back-end >  Java write when the HelloWorld JNI great god help to solve the Error
Java write when the HelloWorld JNI great god help to solve the Error

Time:09-25

D: \ \ JAVA \ LM 2019 _4_10 & gt; Java helloworld
Error: A JNI Error has occurred, both please check your installation and the try again
The Exception in the thread "main" Java. Lang. UnsupportedClassVersionError: the helloworld has had been compiled by a more recent version of the Java Runtime (class file version 56.0), and this version of the Java Runtime only recognizes the class file versions up to 52.0
The at Java. Lang. This defineClass1 (Native Method)
The at Java. Lang. This defineClass (Unknown Source)
The at Java. Security. SecureClassLoader. DefineClass (Unknown Source)
The at java.net.URLClassLoader.defineClass (Unknown Source)
The at java.net.URLClassLoader.access$100 (Unknown Source)
The at java.net.URLClassLoader$1.run (Unknown Source)
The at java.net.URLClassLoader$1.run (Unknown Source)
The at Java. Security. The AccessController. DoPrivileged (Native Method)
The at java.net.URLClassLoader.findClass (Unknown Source)
The at Java. Lang. This loadClass (Unknown Source)
At sun. Misc. The Launcher $AppClassLoader. LoadClass (Unknown Source)
The at Java. Lang. This loadClass (Unknown Source)
At the sun. The launcher. LauncherHelper. CheckAndLoadMain (Unknown Source)


Have a environment variables before a problem but I changed the environment variable so also like

I carry the Java in D: \ Java \ JDK - 12

The class path.; The % JAVA_HOME % \ lib \ dt. Jar; % JAVA_HOME % \ lib \ tools. Jar;

Path contains % JAVA_HOME % \ bin and % JAVA_HOME % \ jre \ bin



CodePudding user response:

12 environment compiler you use JDK, running in the JDK 8 environment, high version compiled, low version is not running. Suggest try to compile and run under the unified environment.

CodePudding user response:

The helloworld has had been compiled by a more recent version of the Java Runtime (class file version 56.0), and this version of the Java Runtime only recognizes the class file versions up to 52.0


Write very clear, this sentence is your helloword the compiler version 56.0, but your jre is 52 version, version are not compatible

CodePudding user response:

Could you tell me how to solve this

CodePudding user response:

Uninstall the old version of the JDK
  • Related