1

I'm trying to update the jdk of an AndroidStudio-App to the newest possible version (From what I've read jdk11).

I have changed the build.gradle to:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}

The version in the settings seems to be 11:

enter image description here

enter image description here

When I type gradlew --version it seems to be java 18. (The version I would like to use, if it were supported)

enter image description here

But even after multiple reloads, restarts, cleans and synchronizations the IDE still behaves as if I would use Java 8.

enter image description here

  • Android Studio Version: Chipmunk | 2021.2.1 Patch 2
  • Gradle Version: 7.5.1
xtay2
  • 453
  • 3
  • 14
  • 1
    You can only use Java 11 language features but not the classes that were added in Java 9-11. `java.net.http.HttpClient` is a new class and thus you can't use it. – Robert Sep 01 '22 at 12:54

1 Answers1

0

I have now found this thread which explains that even the new versions of Android Studio simply don't support all features of Java 11.

xtay2
  • 453
  • 3
  • 14