Home > Blockchain >  Error: A JNI error has occurred, please check your installation and try again: Java 17.0.5
Error: A JNI error has occurred, please check your installation and try again: Java 17.0.5

Time:12-14

I am trying to use Nextflow to run a pipeline for RNA sequence; however I keep having issues with Java.

Currently the error I am receiving is:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/jgit/api/errors/GitAPIException 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(ClassLoader.java:757)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)

I have the following Java Versions, but I will be honest, I tried many many routes to get to this newest version of java (the old one was: openjdk version "1.8.0_332" OpenJDK Runtime Environment (Zulu 8.62.0.19-CA-linux64) (build 1.8.0_332-b09) OpenJDK 64-Bit Server VM (Zulu 8.62.0.19-CA-linux64) (build 25.332-b09, mixed mode))

Now these are the updated versions: $ javac -version javac 17.0.5

$ java -version openjdk version "17.0.5" 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5 8 (build 17.0.5 8) OpenJDK 64-Bit Server VM Temurin-17.0.5 8 (build 17.0.5 8, mixed mode, sharing)

Please help!

CodePudding user response:

A good idea in this situation would be to uninstall and install a newer version of JDK.

CodePudding user response:

You may have missed the note that usually accompanies the error above:

$ nextflow -h
NOTE: Nextflow is not tested with Java 1.8.0_332 -- It's recommended the use of version 11 up to 18

Just make sure you have Java 11 (or later, up to 18) installed.

  • Related