skip to Main Content

I am getting this error when building my project:

Unsupported Java. 
Your build is currently configured to use Java 19.0.2 and Gradle 7.5.

Possible solution:
 - Open Gradle wrapper settings, change `distributionUrl` property to use compatible Gradle version and reload the project

My gradle-wrapper.properties file looks like this:

#Mon Feb 27 20:08:12 IST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

So, the Gradle value is already 7.5. What other change do I need to make here?

Thanks.

3

Answers


  1. Chosen as BEST ANSWER

    I figured it out. The Gradle version has to be changed to 7.6 for it to be compatible with Java 19.0.2.


  2. In My case I upgraded gradle to 8.1,and its working now

    Login or Signup to reply.
  3. For Java 19, need to set gradle version as 7.6 and above.
    Also check below compatibility matrix

    https://docs.gradle.org/current/userguide/compatibility.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search