Skip to content

Instantly share code, notes, and snippets.

@waliahimanshu
Created March 22, 2024 11:14
Show Gist options
  • Save waliahimanshu/8c32fb474052a6796e8d6285476087df to your computer and use it in GitHub Desktop.
Save waliahimanshu/8c32fb474052a6796e8d6285476087df to your computer and use it in GitHub Desktop.
set JAVA_HOME and ANDROID_HOME in mac using zshrc
Tip if you use bash just replace . zshrc with .bash_profile ?
Open Terminal and type in..
open ~/.zshrc
Add the below paths
The path should be where your android installation is located
// check in your android studio the JAVA path used
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
export ANDROID_HOME=/Users/username/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Save file and type in terminal...
source ~/.zshrc
Check to see if it is set: echo $ANDROID_HOME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment