title: "A JNI error has occurred, please check your installation and try again" on running a java program
body: <p>I am learning Java and trying some code on Thread. I made a program using Thread class and it is compiling fine, but when I run the program it is giving the error. The complete error is:</p>
  
  <pre><code>Error: A JNI error has occurred, please check your installation and
  try again
  
  Exception in thread "main"
  java.lang.UnsupportedClassVersionError: Main has been compiled by a
  more recent version of the Java Runtime (class file version 53.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>My thread java file is:</p>
  
  <pre><code>  import java.lang.Thread;
  
      class MyThread extends Thread
      {
          private String s;
  
          public MyThread(String s)
          {
              this.s = s;
          }
  
          public void run()
          {
              System.out.println(s);
          }
      }
  </code></pre>
  
  <p>And my java file with main function is:
      import java.util.Scanner;</p>
  
  <pre><code>class Main
  {
      public static void main(String[] args) {
          Scanner scanner = new Scanner(System.in);
          String s1, s2;
          System.out.print("Enter string for first thread: ");
          s1 = scanner.nextLine();
          System.out.print("Enter string for second thread: ");
          s2 = scanner.nextLine();
          MyThread t1 = new MyThread(s1);
          MyThread t2 = new MyThread(s2);
          t1.start();
          t2.start();
          scanner.close();
      }
  }
  </code></pre>
  
  <p>My OS is Windows 10 Home. I compiled the file using <code>javac Main.java</code> and tried running the compiled .class file with <code>java Main</code>. What is the reason of the error? How can I prevent it?</p>