title: What do I need to do to interpret this Java program?
body: <p>I'm just starting to use Java. I've been following the instructions in the answer to <a href="https://stackoverflow.com/questions/16137713/how-do-i-run-a-java-program-from-the-command-line-on-windows">this question</a> in order to compile and run my first Java program. I have just installed JDK 11 and have set the path to <code>C:\Program Files\Java\jdk-11\bin</code>. Having done that, I've been able to compile my program using the following command:</p>
  
  <pre><code>javac HelloWorld.java
  </code></pre>
  
  <p>(The file is called <code>HelloWorld.java</code>.)</p>
  
  <p>As a result of this a file called <code>HelloWorld.class</code> appears in the directory. Now I've tried to run the program using this command:</p>
  
  <pre><code>java HelloWorld
  </code></pre>
  
  <p>This doesn't work. I get the following output:</p>
  
  <pre><code>Error: A JNI error has occurred, please check your installation and try again
  Exception in thread "main" java.lang.UnsupportedClassVersionError: HelloWorld has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
  </code></pre>
  
  <p>I have looked at <a href="https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi">this question</a>, which combined with the error message I'm getting suggests to me that whatever Java is running my program is meant for older-version files than my compiler is churning out.</p>
  
  <p>Following the advice of the answer to the above question, I have tried running <code>javac -target 8 HelloWorld.java</code>. However, this doesn't work either. I get the following warning:</p>
  
  <pre><code>warning: target release 8 conflicts with default source release 11
  </code></pre>
  
  <p>and no <code>HelloWorld.class</code> gets created.</p>
  
  <p>I have a feeling I need to have Java Runtime Environment 11, but I don't know how you get it. Searching queries like "get JRE 11" sends me back to <a href="https://java.com/en/download/" rel="nofollow noreferrer">the main Java download page</a>, which is offering "version 8".</p>
  
  <p><em>Appendix: the directory I'm keeping <code>HelloWorld.java</code> in is called <code>java</code>, if that makes any difference.</em></p>