skip to Main Content

I use android studio ladybug 24.2.1 In this version، GDK v-21 is Build-in
how to change JDK for Android Studio from 21 to jdk 17.

JDK for Android toolchain is 17 and Android Studio is 21 .I want to make both jdk 17

[screenshot][1] [1]: https://i.sstatic.net/82kqlmGT.png

2

Answers


  1. Check Installed JDKs, Ensure the desired JDK version is installed.

    Open Android Studio Preferences

    Open Android Studio.
    Go to Preferences -> Navigate to JDK Settings

    In the Preferences window, go to:
    Build, Execution, Deployment > Build Tools > Gradle. Change the JDK Path

    enter image description here

    Under "Gradle JDK," click the dropdown and select your desired JDK version.

    enter image description here

    Login or Signup to reply.
  2. I had a similar issue with not being able to set it via studio so the easiest way

    • Download jdk separately.
    • Configure my project to use 17
      • flutter config –jdk-dir yourJDK path
    • Optionally (Some plugins may require) update
      • sourceCompatibility JavaVersion.VERSION_17
      • targetCompatibility JavaVersion.VERSION_17
      • jvmTarget = ’17’
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search