Android Studio: Buildtools 24.0.1 requires Java 1.8 or above.

24,698

Solution 1

Make sure your JDK Version through Project Structure

enter image description here

You can add this in your gradle section

    compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

Solution 2

On a Mac just double-click on the app and a new modal windows will show. Then select 'Open Module Setting' and go to 'SDK Location'.

Share:
24,698
lang2
Author by

lang2

Updated on July 10, 2022

Comments

  • lang2
    lang2 almost 2 years

    I'm trying to setup an Android dev environment on Mac.

    My starting point is Java 1.7 I believe. So I installed android studio and opened the project I'd like to build. And it says:

    Error:Buildtools 24.0.1 requires Java 1.8 or above.  Current JDK version is 1.7.
    

    So I went and download Java 1.8 u101 and installed that. No luck. Then I removed Android Studio and re-installed it and re-installed the SDK and still no luck.

    My Java Control Pannel says: Java 8 update 101. Output of /usr/bin/java:

    java version "1.8.0_101"
    Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
    

    Output of /usr/bin/javac

    javac 1.8.0_101
    

    What have I done wrong?

  • lang2
    lang2 almost 8 years
    I'm using Mac. Not sure if it's the same.