aionnetwork / AVM

Enabling Java code to run in a blockchain environment
https://theoan.com/
MIT License
49 stars 25 forks source link

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/aion/cli/AvmCLI has been compiled by a more recent version of the Java Runtime #372

Closed miguelmota closed 5 years ago

miguelmota commented 5 years ago

I'm going through the hello world tutorial and coming across an error:

$ wget https://github.com/aionnetwork/AVM/releases/download/avmtestnet-2019-02-08/avmtestnet-2019-02-08.tar.bz2
$ tar xvzf avmtestnet-2019-02-08.tar.bz2
$ cd aion/lib
$ java -jar avm.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/aion/cli/AvmCLI 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 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)

I'm on macOS and not the most familiar with Java. Any help is appreciated. Thanks

jeff-aion commented 5 years ago

That error means that you have JDK8 and the AVM requires JDK10. You will need to make sure that you have at least JDK10 installed and that it is the one your system is trying to use (you can verify this on the command line with java -version to see the version and then which java will show you where the one you are using is installed).

miguelmota commented 5 years ago

Thanks! Updating to JDK11 fixed it.