jvisualvm can not locate Java installation
Asked Answered
U

3

15

I am facing following issues while running jvisualvm -

Java Related environment variables set on machine

java related environment variables

Following are PATH variable details, there is no path mentioned as C:\apps\Java8

Path=C:\ProgramData\Oracle\Java\javapath;
C:\windows\system32;
C:\windows;
C:\windows\System32\Wbem;
C:\windows\System32\WindowsPowerShell\v1.0\;
C:\windows\System32\OpenSSH\;
C:\Program Files\Microsoft\Web Platform Installer\;
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files\Microsoft DNX\Dnvm\;
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;
D:\apps\gradle-5.5.1-bin\bin;
D:\apps\apache-ant-1.10.5\bin;
C:\apps\Java\Java8\bin;
C:\Program Files\nodejs\;

When I am running jvisualvm.exe, I am getting following error, from the error it seems that jvisualvm is looking into some config file to locate JDK home path:

enter image description here

On this message I click "Yes" button then getting following error which says, you are running VisualVM is running from JRE -

enter image description here

Undefined answered 31/12, 2019 at 2:37 Comment(4)
I have some question about your Java setup. Is there a full JRE installation in c:\apps\java\java8\jre? What is in c:\apps\java8 directory? Is there or was there JDK installed?Haifa
C:\apps\java\java8 is JDK installation. I don't have anything in "c:\apps\java8".Undefined
Ok, please start jvisualvm from WIndows command prompt with jvisualvm.exe --trace <path_to_log_file> and publish the content of the log file.Haifa
Try updating jdk path in visualvm.conf in "etc" folder.Herald
H
34

Try updating JDK path in visualvm.conf in the etc folder.

enter image description here

Herald answered 16/7, 2021 at 13:52 Comment(1)
Straight to the point. Worked! Thanks!Abeokuta
A
9

As explain here and by Tarun Chopra.

You have 2 options:

  1. Launch bin/visualvm.exe at the command line with the --jdkhome parameter and your JDK location
  2. Update the visualvm_jdkhome variable in the file etc/visualvm.conf of your VisualVM directory.
Aloud answered 2/3, 2022 at 11:42 Comment(1)
NB: The JDK location must be the absolute path (exemples: /Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home, C:\Program Files\Java\jdk-17.0.2, etc.).Aloud
C
1

Open C:...\visualvm_217\etc\visualvm.conf

uncomment line 72

#visualvm_jdkhome="/path/to/jdk"

and specify you jdk location

visualvm_jdkhome="C:\Program Files\Java\jdk-17.0.2"

good luck

Cultivator answered 14/11, 2023 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.