title: How to fix Java UnsupportedClassVersionError
body: <p>I've run into this error a few times trying to brush up on my Java. Looked up solutions on the internet and most suggestions were to compile or run the file with a flag/option argument to specify the correct interpreter version. My question is, is there a more permanent solution to this? (im using vscode. Guessing there is something i can add to my settings.json file in the workspace- but what?)</p>
  <pre><code>Error: LinkageError occurred while loading main class com.example.demo.DemoApplication
          java.lang.UnsupportedClassVersionError: com/example/demo/DemoApplication has been compiled by a more recent version of the Java Runtime (class file version 59.65535), this version of the Java Runtime only recognizes class file versions up to 58.0
  </code></pre>
  <p>here is my version details</p>
  <pre><code>$ java --version
  java 14.0.2 2020-07-14
  Java(TM) SE Runtime Environment (build 14.0.2+12-46)
  Java HotSpot(TM) 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
  
  </code></pre>
  <p>Id like to not have to use flags whenever I compile and run a java file from the command line. Bonus points to you if you can explain why this problem happens in the first place? back when i learned java, you used to have to download and install the JRE and JDK separately. I can understand mistakenly downloading incompatible versions, but now it seems the JRE comes prepackaged with the JDK. How is it possible to have incompatible versions of the compiler and interpreter if this is the case?</p>