This article provides the steps to locate Java JDK location on macOS. The system version is 11.1 (macOS Big Sur).
- Open Terminal.
- Change directory to /Library/Java/JavaVirtualMachines.
- List JDKs:
- In my system, there are two SDKs (JDK8 and JDK11):
Setup JAVA_HOME variable
JAVA_HOME variable is required by a number of Java dependent applications. Use the following command line to setup the variable: