Skip to content

Android guide: How to set java home path on mac #1420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions www/docs/en/12.x-2025.01/guide/platforms/android/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
On Linux or macOS versions prior to Catalina, use any text editor to create or modify the `~/.bash_profile` file.
<br>On macOS Catalina and newer, create or modify the `~/.zprofile` file, as the default shell has changed.

##### ANDROID_HOME

Add the following line to your shell's profile to set up the `ANDROID_HOME` environment variable.

**Linux:**
Expand All @@ -322,6 +324,18 @@ export PATH=$PATH:$ANDROID_HOME/build-tools/
export PATH=$PATH:$ANDROID_HOME/emulator/
```

#### JAVA_HOME

**macOS:**

When you installed the Java Development Kit, as described in this guide, you can get the java home path by executing:

`echo $(/usr/libexec/java_home)`

Set `JAVA_HOME` like you already did it for `ANDROID_HOME`.

### Reload Terminal

Reload your terminal to see this change reflected or run the following command:

**Linux and macOS older then Catalina:**
Expand Down
14 changes: 14 additions & 0 deletions www/docs/en/dev/guide/platforms/android/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
On Linux or macOS versions prior to Catalina, use any text editor to create or modify the `~/.bash_profile` file.
<br>On macOS Catalina and newer, create or modify the `~/.zprofile` file, as the default shell has changed.

##### ANDROID_HOME

Add the following line to your shell's profile to set up the `ANDROID_HOME` environment variable.

**Linux:**
Expand All @@ -340,6 +342,18 @@ export PATH=$PATH:$ANDROID_HOME/build-tools/
export PATH=$PATH:$ANDROID_HOME/emulator/
```

#### JAVA_HOME

**macOS:**

When you installed the Java Development Kit, as described in this guide, you can get the java home path by executing:

`echo $(/usr/libexec/java_home)`

Set `JAVA_HOME` like you already did it for `ANDROID_HOME`.

### Reload Terminal

Reload your terminal to see this change reflected or run the following command:

**Linux and macOS older then Catalina:**
Expand Down