title: "Error: LinkageError occurred while loading main class src.Readability" compile and running a Java file
body: <p>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 <code>java -version</code> in the terminal I get -</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>I have restarted idea for no change.</p>
  
  <p>I've followed this guide - <a href="https://www.baeldung.com/java-lang-unsupportedclassversion" rel="nofollow noreferrer">https://www.baeldung.com/java-lang-unsupportedclassversion</a> - but for one thing when I input <code>echo %JAVA_HOME%</code> the output is <code>%JAVA_HOME%</code>, no path.</p>
  
  <p>I have corrected the file path in <code>Environment Variables</code> to <code>C:\...\JDK-13.0.2\bin</code></p>
  
  <p>There are a few other entries in <code>PATH Environment Variables</code></p>
  
  <p><code>C:\Program Files (x86)\Common Files\Oracle\Java\javapath</code>
  <code>C:\ProgramData\Oracle\Java\javapath</code></p>
  
  <p>Are these correct? Do I need to alter them?</p>
  
  <p>This is what happens when I compile my Java file -</p>
  
  <pre><code>C:\Users\si_au\OneDrive\Coding\Readability&gt;javac src/Readability.java
  
  C:\Users\si_au\OneDrive\Coding\Readability&gt;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
  </code></pre>
  
  <p>Edit: I have followed the paths of the environment variables listed above, <code>C:\Program Files (x86)\Common Files\Oracle\Java\javapath</code> and <code>C:\ProgramData\Oracle\Java\javapath</code> 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 <code>java -version</code> is entered. Is this my problem?</p>