Find JAVA_HOME JDK Location on macOS

visibility 726 access_time 2 years ago languageEnglish

This article provides the steps to locate Java JDK location on macOS. The system version is 11.1 (macOS Big Sur).

Find JDK

  1. Open Terminal.
  2. Change directory to /Library/Java/JavaVirtualMachines.
    cd /Library/Java/JavaVirtualMachines
  3. List JDKs:
    ls
  4. In my system, there are two SDKs (JDK8 and JDK11):
bash-3.2$ ls
jdk-11.0.9.jdk          jdk1.8.0_201.jdk

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:

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-11.0.9.jdk/Contents/Home"
info Last modified by Administrator 2 years ago copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

timeline Stats
Page index 1.40
More from Kontext
Connect to Hive via HiveServer2 JDBC Driver
visibility 4,993
thumb_up 0
access_time 3 years ago
Add Constant Column to PySpark DataFrame
visibility 7,746
thumb_up 0
access_time 2 years ago
Spark Scala: Load Data from MySQL
visibility 1,464
thumb_up 0
access_time 2 years ago
Spark Scala: Load Data from MySQL