Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
Using Android Studio's built-in Java on the command line in MacOS

There's lots of info here (much obsolete) on installing Java on the mac, and getting Android Studio to use the right versions. But recent builds of Android Studio (2.2 and on?) provide their own Java, and for most Mac users, there's just no reason (or desire) to install a browser or command line Java anymore ... until you want to use any of the Studio's shell tools, and realize they're all in java, and the studio's Java is not integrated into the wonder that is java_home.

Obviously, your path vars need to be updated to include the Android SDK, and JAVA_HOME and JDK_HOME need to be set, but the actual details of doing so are thin on the ground.

So ... what are the correct paths and settings needed to simply use the Studio's embedded java and android tools in MacOS shells, instead of installing extra Java instances from Oracle?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Add this to your ~/.profile or similar:

# Use the JDK embedded with Android Studio 2020.3+ for command-line builds
export JAVA_HOME='/Applications/Android Studio.app/Contents/jre/Contents/Home'

# (Use the next line instead for older Android Studio 2.2+)
#export JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home'

Command-line builds via gradlew, and any other well-behaved script, will then use the version of the SDK that ships with Android Studio 2.2+.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!