I've always been under the impression that the default Java is determined by searching for the first Java executable that can be found in one of the given directories in the PATH system environment variable.
Now, when I use java -version
on command line some Java on my system is called and shows version information even though no Java-path is on the PATH system environment variable.
So how does the command line decide what Java to use? I.e. where can this be configured?