1

I have been trying to get my JDK and JRE to match for a couple hours now, but do not know what to do. Any help appreciated.

I've checked the versions and realized they are different. I have already installed the latest JDK but do not know how to change the JRE to match the JDK.

javac -version javac 12.0.1

java -version java version "1.8.0_211"

C:\Users\jacob\OneDrive\Desktop\Code>java Ah Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: Ah has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I expect to be able to have the same versions so that my code will run, but it will not run.

Jacob
  • 33
  • 4

2 Answers2

0

It means that the environment variable for javac ( java compiler ) is pointing to a different version compared to the environment variable for java( java run-time ) command.

Check this comment and set up the correct environment variables.

BogdanSucaciu
  • 794
  • 4
  • 12
0

Try uninstalling JRE and only install JDK. It worked for me.