Could not determine java version from ‘11.0.8’

The project uses Gradle version which is incompatible with Studio running on Java 10 or newer


I have never been in the habit of writing blog articles before. I just joined a new company and took over an old project. When I met some problems, I felt it was more shareable.

  • Local environment: Android Studio 4.2, JDK 1.8

At first I thought there was a problem with the JDK in the project, so I went to check the JDK version installed locally and switched to JDK1.8 everywhere. The problem still crashed

Back to the error log: “The project uses Gradle version which is incompatible with Studio running on Java 10 or newer.” Not compatible with Android Studio running after java10. The 4.2 Android Studio version I downloaded was too new and incompatible with the Gradle version of the project. The 4.2 version of Android Studio itself runs on JAVA 11, so this error is reported. It was completely misunderstood at first.

There are two solutions to this idea:

  1. Change the Gradle version of your project
  2. Changes to earlier versions of Android Studio

  • Go First Option 1:

As Android Studio prompts you to change Gradle Wrapper version to 4.8.1, this problem has been solved. Should we celebrate now? NO, NO, NO, this problem is solved, thousands of problems stand up, until the final need to change the introduction of other modules, this time really nothing can be done.

  • Solution 2:1. Download an older version of Android Studio 3.4 and try different installation paths. Install both versions of Android Studio on the local computer

Android Studio has been installed locally, so you cannot change the installation path, you can only overwrite the installation, failed!!

  1. Final solution: Change the Java version running Android Studio (switch Android Studio runtime JDK)
  • Install the Choose Runtime plug-in

  • Press CTRL + Shift + A to search Choose Runtime

  • Select the 1.8 JDK that is already installed locally (the default was 11.0.8 JDK)

  • Click install

  • When I clicked Install, Android Studio automatically restarted, and I quietly waited for success.

To the surprise

  • Surprise 1: After the first change, Android Studio flashes back and opens again.
  • Surprise 2: IN order to write blog screenshots, I tried all the operations again, but the second operation failed directly. The problem remained the same. What’s going on? Falling apart again.

I changed the JDK path of Android Studio to the same path as the JDK used to switch between Choose Runtime and Android Runtime.So far the problem has been solved perfectly.


How does the RUNTIME JDK switch back to the default JDK11

Two ways:

  1. Open the folder C:\Users\ User name \AppData\Roaming\Google\AndroidStudio4.2, delete the studio64.exe. JDK file, and restart AndroidStudio.

2. To open the Choose Runtime plug-in, click Use Default.