Just for kicks, I installed the exact same Java installations that you have:
- Oracle JDK 11.0.2
- Oracle JDK 1.8.0_172
- Oracle JRE 1.8.0_172 (for you, it's listed as
- AdoptOpenJDK JDK 1.8.0_265
- Oracle JDK 1.8.0_121
But, still only four matches:
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (4):
11.0.2, x86_64: "Java SE 11.0.2" /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home
1.8.0_265, x86_64: "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
1.8.0_172, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home
1.8.0_121, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
Also note: the format of our
java_home invocations are different. You've got (brackets) around your architecture, and the publisher isn't listed for me.
What to do next
There's an easy long-term fix here that we briefly discussed earlier:
bootstrap should run
libexec and parse out the correct JDK.
However, before committing to it (there's multiple formats! I don't want to parse all those 😉), I'd really like to track down the root cause of our differing
java_home output. It could hint towards a cleaner solution , or perhaps it might allow us to make the docs more concrete (if you're JRE is showing up, it's because of <x>).
One theory I'm thinking about is that Big Sur has changed the behaviour of
java_home. As a last resort, I can find a spare drive and opt into the public beta, too.
Before jumping into that, though, would you be able to do the following things and comment the results?
"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -version. This will hopefully explain why its version is different than the others (that trailing
- Do an
ls -al "/Library/Internet Plug-Ins" to see if there's any linking going on
- Do a big
ls -al /Developer/Java /System/Library/Java /Library/Java $HOME/Library/Java $HOME/Developer/Java /Developer/Java/JavaVirtualMachines /System/Library/Java/JavaVirtualMachines /Library/Java/JavaVirtualMachines $HOME/Library/Java/JavaVirtualMachines $HOME/Developer/Java/JavaVirtualMachines, which will hopefully explain how that JRE is detected.