我试图通过以下命令开始安装nextflow:
wget -qO- https://get.nextflow.io | bash
我得到了一个错误:
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:760)
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 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:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
如果我运行命令java -version
输出如下:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
我还尝试安装不同版本的java,并将它们设置为默认值:
update-java-alternatives --list
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
sudo update-java-alternatives --set java-1.11.0-openjdk-amd64
update-alternatives: error: no alternatives for jaotc
update-alternatives: error: no alternatives for jar
update-alternatives: error: no alternatives for jarsigner
update-alternatives: error: no alternatives for javac
update-alternatives: error: no alternatives for javadoc
update-alternatives: error: no alternatives for javap
update-alternatives: error: no alternatives for jcmd
update-alternatives: error: no alternatives for jconsole
update-alternatives: error: no alternatives for jdb
update-alternatives: error: no alternatives for jdeprscan
update-alternatives: error: no alternatives for jdeps
update-alternatives: error: no alternatives for jfr
update-alternatives: error: no alternatives for jhsdb
update-alternatives: error: no alternatives for jimage
update-alternatives: error: no alternatives for jinfo
update-alternatives: error: no alternatives for jlink
update-alternatives: error: no alternatives for jmap
update-alternatives: error: no alternatives for jmod
update-alternatives: error: no alternatives for jps
update-alternatives: error: no alternatives for jrunscript
update-alternatives: error: no alternatives for jshell
update-alternatives: error: no alternatives for jstack
update-alternatives: error: no alternatives for jstat
update-alternatives: error: no alternatives for jstatd
update-alternatives: error: no alternatives for rmic
update-alternatives: error: no alternatives for serialver
update-alternatives: error: no alternatives for jaotc
update-alternatives: error: no alternatives for jarsigner
update-alternatives: error: no alternatives for jar
update-alternatives: error: no alternatives for javac
update-alternatives: error: no alternatives for javadoc
update-alternatives: error: no alternatives for javap
update-alternatives: error: no alternatives for jcmd
update-alternatives: error: no alternatives for jdb
update-alternatives: error: no alternatives for jdeprscan
update-alternatives: error: no alternatives for jdeps
update-alternatives: error: no alternatives for jfr
update-alternatives: error: no alternatives for jhsdb
update-alternatives: error: no alternatives for jimage
update-alternatives: error: no alternatives for jinfo
update-alternatives: error: no alternatives for jlink
update-alternatives: error: no alternatives for jmap
update-alternatives: error: no alternatives for jmod
update-alternatives: error: no alternatives for jps
update-alternatives: error: no alternatives for jrunscript
update-alternatives: error: no alternatives for jshell
update-alternatives: error: no alternatives for jstack
update-alternatives: error: no alternatives for jstatd
update-alternatives: error: no alternatives for jstat
update-alternatives: error: no alternatives for rmic
update-alternatives: error: no alternatives for serialver
update-java-alternatives: jdk alternative does not exist: /usr/lib/jvm/java-11-openjdk-amd64/bin/jconsole
我该怎么做才能解决这个问题?是否需要完全卸载并重新安装java?如果是,我如何安装它?
发布于 2022-10-18 04:51:11
Nextflow只需要Java 11或更高版本的。java -version
的输出应该如下所示:
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)
如果您在Ubuntu上,可以使用以下方法安装OpenJDK 11:
sudo apt-get install openjdk-11-jdk
如果安装了其他java
选项,请使用update-java-alternatives
(需要java-common
)设置所需的版本:
sudo update-java-alternatives --set java-1.11.0-openjdk-amd64
如果您看到一些“无法替代”错误,通常您可以忽略它们,或者将它们更多地视为警告,因为update-java-alternatives
应该已经正确地重新配置了这些选项,以便为指定的版本启用所有必需的组件。
https://stackoverflow.com/questions/74103638
复制相似问题