I have oracle and adoptOpen's JDK installed.
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
11.0.5, x86_64: "Java SE 11.0.5" /Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home
11.0.4, x86_64: "AdoptOpenJDK 11" /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
1.8.0_161, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
In the past, i switched between jdk11 and jdk1.8 by using:
alias jdk11='export JAVA_HOME=`/usr/libexec/java_home -v11`'
alias jdk8='export JAVA_HOME=`/usr/libexec/java_home -v1.8`'
but I can't see how to select between the two jdk11 providers. java_home -v11
will always get me the Oracle path and the help/manpage do not show any option that I could use to differentiate them.
How can I tell java_home
that I want "AdoptOpenJDK 11" and not "Java SE 11"?