简体   繁体   中英

visualvm fails with “No jdkhome found” on Ubuntu 15.10 with Oracle JDK

I installed Oracle JDK from the webupd8team/java PPA, and then installed the visualvm package. When starting visualvm , I get the following error message:

[beni:~]$ visualvm
No jdkhome found

My $JAVA_HOME is set correctly to /usr/lib/jvm/java-7-oracle .

Also, when starting visualvm with the jdkhome property set, I get the same error:

[beni:~]$ visualvm --jdkhome $JAVA_HOME
No jdkhome found

visualvm checks the following three directories for a JDK:

  • /usr/lib/jvm/java-7-openjdk-$ARCH
  • /usr/lib/jvm/java-8-openjdk-$ARCH and
  • /usr/lib/jvm/default-java

From the /usr/bin/visualvm start script:

visualvm_jdkhome=
for j in /usr/lib/jvm/java-7-openjdk-$ARCH /usr/lib/jvm/java-8-openjdk-$ARCH /usr/lib/jvm/default-java; do
    if [ -x $j/bin/javac ]; then
       visualvm_jdkhome=$j
       break
    fi
done

So make /usr/lib/jvm/default-java a symlink to $JAVA_HOME , and visualvm will find the right JDK.

cd /usr/lib/jvm
sudo ln -Tsf java-7-oracle default-java

In my case even the symlink of default-java didn't fixed the problem. To fix, I did:

Edited jvisualvm and add any "trash" into jdkhome variable

  • $ sudo vi /usr/bin/jvisualvm

jdkhome=/tmp

Then started the program passing parameter:

  • /usr/bin/jvisualvm --jdkhome /usr/lib/jvm/myJava7

Note: today (2016), with my version is working only with java7

Update :now, in 2017, using version 1.3.8, it's working with Java 8. But I needed to add visualvm_jdkhome=/tmp , in /usr/bin/visualvm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM