I (think I) have mismatched JDK and JRE versions but I have to set InteliJ idea to JDK-13.0.2, JRE to 13 (File > Project Settings > Project), but when I check java -version in the terminal I get -
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
I have restarted idea for no change.
I've followed this guide - https://www.baeldung.com/java-lang-unsupportedclassversion - but for one thing when I input echo %JAVA_HOME% the output is %JAVA_HOME%, no path.
I have corrected the file path in Environment Variables to C:\...\JDK-13.0.2\bin
There are a few other entries in PATH Environment Variables
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\ProgramData\Oracle\Java\javapath
Are these correct? Do I need to alter them?
This is what happens when I compile my Java file -
C:\Users\si_au\OneDrive\Coding\Readability>javac src/Readability.java
C:\Users\si_au\OneDrive\Coding\Readability>java src.Readability
Error: LinkageError occurred while loading main class src.Readability
java.lang.UnsupportedClassVersionError: src/Readability has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the
Java Runtime only recognizes class file versions up to 54.0
Edit: I have followed the paths of the environment variables listed above, C:\Program Files (x86)\Common Files\Oracle\Java\javapath and C:\ProgramData\Oracle\Java\javapath and they each have three files in the folder. "java", "javaw" and "javaws". The first two have version number 10.0.2.0, which is what is shown in the terminal when java -version is entered. Is this my problem?