


rwxr-xr-x 1 root wheel 136K /usr/bin/javawsĪctually, many files in /usr/bin are the same: $ find /usr/bin | sort | xargs md5 | grep d50afbfa4f5d05e8db7ad88c30390888 rwxr-xr-x 1 root wheel 136K /usr/bin/javapackager rwxr-xr-x 1 root wheel 136K /usr/bin/javap rwxr-xr-x 1 root wheel 136K /usr/bin/javah rwxr-xr-x 1 root wheel 136K /usr/bin/javadoc rwxr-xr-x 1 root wheel 136K /usr/bin/javac rwxr-xr-x 1 root wheel 136K /usr/bin/java rwxr-xr-x 1 root wheel 136K /usr/bin/jarsigner rwxr-xr-x 1 root wheel 136K /usr/bin/jar OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)Īll the Java commands in /usr/bin have the same size (136Kb in my case): $ ll -h /usr/bin/ja* OpenJDK Runtime Environment (build 16.0.1+9-24) $ JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/ & java -version $ JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/ & java -version


Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode) Java(TM) SE Runtime Environment (build 1.8.0_112-b16) I have installed (manually, by unzipping the openjdks into /Library/Java/JavaVirtualMachines/) many versions of Java, and just by setting a different JAVA_HOME, the version switches: $ JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home & java -version I think that /usr/bin/java is a proxy application, part of MacOS, that calls the java command in the current java installation as defined by JAVA_HOME env var.Īnd this is the same for all the java related commands in /usr/bin I can't fully answer your question but I have a few practical clues I can share.
