How to resolve an error "A JNI error has occurred, please check your installation and try again" when you compile a java program?

I am new in learning Java. Trying to run "hello world!" An example of what I run is below.
class hello {

 public static void main(String args[]) {

 System.out.println("Hello, world!");

}

}

Javac compiles, but the generated class is not interpretiruya. I get the following error:
***:~/Documents/JavaSampl$ javac hello.java
***:~/Documents/JavaSampl$ java hello
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: hello has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 53.0
 at java.lang.ClassLoader.defineClass1(java.base@9-internal/Native Method)
 at java.lang.ClassLoader.defineClass(java.base@9-internal/ClassLoader.java:939)
 at java.security.SecureClassLoader.defineClass(java.base@9-internal/SecureClassLoader.java:152)
 at jdk.internal.loader.BuiltinClassLoader.defineClass(java.base@9-internal/BuiltinClassLoader.java:553)
 at jdk.internal.loader.BuiltinClassLoader.access$200(java.base@9-internal/BuiltinClassLoader.java:88)
 at jdk.internal.loader.BuiltinClassLoader$3.run(java.base@9-internal/BuiltinClassLoader.java:466)
 at jdk.internal.loader.BuiltinClassLoader$3.run(java.base@9-internal/BuiltinClassLoader.java:460)
 at java.security.The AccessController.doPrivileged(java.base@9-internal/Native Method)
 at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(java.base@9-internal/BuiltinClassLoader.java:459)
 at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(java.base@9-internal/BuiltinClassLoader.java:406)
 at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:364)
 at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184)
 at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
 at sun.launcher.LauncherHelper.loadMainClass(java.base@9-internal/LauncherHelper.java:585)
 at sun.launcher.LauncherHelper.checkAndLoadMain(java.base@9-internal/LauncherHelper.java:497)

Tell me how to solve it. Thanks in advance!
June 3rd 19 at 20:21
1 answer
June 3rd 19 at 20:23
Solution
Don't need to be a Pro in Java, enough to be able to use a translator
5b509b2f2253c351493968.png
You compile with Java 10, and trying to run with Java 9.
Thank you, do in parallel jdk 10, jdk stood 9. The last one was deleted. Now everything is OK. - margarett.Powlows commented on June 3rd 19 at 20:26

Find more questions by tags Java