I have just got a mac mini with M1 processor, and I find this behaviour very weird. Basically, when running /usr/libexec/java_home -v ##
I can see that only the first time the JDK path is found and replaced. If I run it a second time even with a -V
flag, I see it finds the right JDK path, yet it never replaces the old one, in fact making the whole thing stale.
Any idea why? This is an example taken from my terminal.
lda@Lucios-Mac-mini ~ % /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
15 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK 15" /Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home
13.0.5.1 (arm64) "Azul Systems, Inc." - "Zulu 13.35.1017" /Library/Java/JavaVirtualMachines/zulu-13.jdk/Contents/Home
11.0.9.1 (arm64) "Azul Systems, Inc." - "Zulu 11.43.1015" /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home
lda@Lucios-Mac-mini ~ % java --version
openjdk 15 2020-09-15
OpenJDK Runtime Environment AdoptOpenJDK (build 15+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15+36, mixed mode, sharing)
lda@Lucios-Mac-mini ~ % export JAVA_HOME=$(/usr/libexec/java_home -v11)
lda@Lucios-Mac-mini ~ % java --version
openjdk 11.0.9.1 2020-11-04 LTS
OpenJDK Runtime Environment Zulu11.43+1015-CA (build 11.0.9.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+1015-CA (build 11.0.9.1+1-LTS, mixed mode)
lda@Lucios-Mac-mini ~ % export JAVA_HOME=$(/usr/libexec/java_home -v15)
lda@Lucios-Mac-mini ~ % java --version
openjdk 11.0.9.1 2020-11-04 LTS
OpenJDK Runtime Environment Zulu11.43+1015-CA (build 11.0.9.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+1015-CA (build 11.0.9.1+1-LTS, mixed mode)
lda@Lucios-Mac-mini ~ % export JAVA_HOME=$(/usr/libexec/java_home -v13)
lda@Lucios-Mac-mini ~ % java --version
openjdk 11.0.9.1 2020-11-04 LTS
OpenJDK Runtime Environment Zulu11.43+1015-CA (build 11.0.9.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+1015-CA (build 11.0.9.1+1-LTS, mixed mode)