How does /usr/libexec/java_home know where are my jdks are installed?

Hi. I am wandering how does /usr/libexec/java_home know where are my jdks are installed? I see that when I move one of my jdks from one location to another the /usr/libexec/java_home -V reflects the changes right away. So how does it know where are all my jdks are and how does it track it's relocation?

Replies

how does /usr/libexec/java_home know where are my jdks are installed?

As far as I can tell it doesn’t do anything extra clever but rather searches for the Java runtimes in a set of standard locations (like ~/Library/Java/JavaVirtualMachines and /Library/Java/JavaVirtualMachines).

when I move one of my jdks from one location to another

Can you post a concrete example of this?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"