Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
645 views
in Technique[技术] by (71.8m points)

java - #error running igv **Error: A JNI error has occurred, please check your installation and try again

I already looked in previous questions since it appears that my issue is quite common. However I still cannot solve this problem. When I run the IGV program I got this error:

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)

I checked java versions:

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

If I understand correctly I needed to install a uptdated version of java (e.g. 11): so I tried:

sudo apt update    
sudo apt install openjdk-11-jdk 

however, still there is the old version

 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    

I also tried manually with:

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

I really don't understand how to solve this issue thanks for your help

question from:https://stackoverflow.com/questions/65873223/error-running-igv-error-a-jni-error-has-occurred-please-check-your-installa

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I did:

    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.

Still the same error "Error: A JNI error has occurred, please check your installation and try again"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...