ubuntu # error running igv**错误:发生JNI错误,请检查您的安装并重试

5fjcxozz  于 2023-11-17  发布在  其他
关注(0)|答案(3)|浏览(106)

我已经看过以前的问题,因为它似乎我的问题是很常见的.然而,我仍然无法解决这个问题.当我运行IGV程序,我得到了这个错误:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/broad/igv/ui/Main 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: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)

字符串
查看Java版本:

java -version
openjdk version "1.8.0_152-release"    
OpenJDK Runtime Environment (build 1.8.0_152-release-1056-b12)    
OpenJDK 64-Bit Server VM (build 25.152-b12, mixed mode)    

javac -version
javac 1.8.0_152-release    

which java    
/home/sche/anaconda2/bin/java


如果我理解正确的话,我需要安装一个更新版本的java(例如11):所以我试着:

sudo apt update    
sudo apt install openjdk-11-jdk


然而,仍然有旧版本

java -version
openjdk version "1.8.0_152-release"    
OpenJDK Runtime Environment (build 1.8.0_152-release-1056-b12)     
OpenJDK 64-Bit Server VM (build 25.152-b12, mixed mode)

javac -version    
javac 1.8.0_152-release


我也试过手动操作:

curl -O https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz    
tar zxvf openjdk-11.0.2_linux-x64_bin.tar.gz    
sudo mv jdk-11* /usr/local/    
sudo vim /etc/profile.d/jdk.sh
export JAVA_HOME=/usr/local/jdk-11.0.2
export PATH=$PATH:$JAVA_HOME/bin


我真的不知道如何解决这个问题,谢谢你的帮助。

nsc4cvqm

nsc4cvqm1#

解决它,

set JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
export PATH=$JAVA_HOME/bin:$PATH

字符串

wj8zmpe1

wj8zmpe12#

我做到了:

update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-11-openjdk-amd64/" 3
    update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-11-openjdk-amd64/" 3

sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   1111      auto mode
* 1            /usr/lib/jvm/java-11-openjdk-amd64/           3         manual mode
  2            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   1111      manual mode

Press <enter> to keep the current choice[*], or type selection number: 1

sudo update-alternatives --config javac
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-11-openjdk-amd64/bin/javac
Nothing to configure.

字符串
仍然是相同的错误“错误:发生JNI错误,请检查您的安装并重试”

rdrgkggo

rdrgkggo3#

我遇到了同样的问题,并通过指定IGV应该使用的Java版本(v11,而不是v1.8)解决了这个问题。

export JAVA_HOME="/path/to/openjdk-11.0.13-h87a67e3_0"
export PATH=$JAVA_HOME/bin:$PATH
igv

字符串
此代码保存为runigv.sh。要运行IGV:

bash runigv.sh


这是一个变通的办法,所以也许有更优雅的解决方案。

相关问题