How to make a Java version installed in Mac OS X not accessible system wide?

To make a Java version not accessible system wide but only from the terminal Go to /Library/Java/JavaVirtualMachines and then inside specific JDK directory. Inside Contents/ rename Info.plist to Info.plist.disabled Restart the computer Ref: https://stackoverflow.com/questions/21964709/how-to-set-or-change-the-default-java-jdk-version-on-os-x