Now you can just install Liberica JDK pkg-distibution using brew
and will never face the problem mentioned below:
brew tap bell-sw/liberica
brew cask install liberica-jdk11
Usually I do not have Oracle Java installed on my OSX with Apple/Oracle installer. To manage Java and other JVM tools versions I use SDKMAN!.
So I had both VisualVM (sdk i visualvm 1.4.1
) and Java (sdk i . java 8.0.181-zulu
) installed with SDKMAN.
Then I wanted to start VisualVM with visualvm
command and got a message:
Unable to find any JVMs matching version "1.8.0+". Cannot find java. Please use the --jdkhome switch.
Such error often happens when you have Java installed locally and OSX does not really know about it, only your shell knows.
The solution for the problem is usually to edit configuration file of desired program to explicitly point to Java path.
In this particular case first locate the visualvm
path, which visualvm
:
~/.sdkman/candidates/visualvm/current/bin/visualvm
You can also find a configuration file near here located at:
~/.sdkman/candidates/visualvm/current/etc/visualvm.conf
Open it, find the visualvm_jdkhome
and uncomment it providing a correct path to JDK, in my case:
/Users/user/.sdkman/candidates/java/8.0.181-zulu
That's it, now you can use VisualVM
Thanks mate that's been real helpful