I have in my .zshrc
the following line which pick which JAVA_HOME it is
export JAVA_HOME=$(/usr/libexec/java_home -v '1.8*')
I used to only have AdoptOpenJdk, hence doing that can let me easily pick AdoptOpenJdk version 1.8
However, after installing Zulu, when I run java_home -V
, I have the below
./java_home -V
Matching Java Virtual Machines (2):
1.8.0_282 (arm64) "Azul Systems, Inc." - "Zulu 8.52.0.23" /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
1.8.0_282 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
After that, now my JAVA_HOME which is running /usr/libexec/java_home -v '1.8*'
to determined is pointing to Zulu open jdk
.
How can I get it back to AdoptJDK by just using java_home
command?
Try using