8

when trying to run ./gradlew setupDecompWorkspace eclipse I get the following error: Could not detrmine java version from 17.0.1.

the gradle-wrapper distributionUrl is gradle-2.7-bin.zip and my current JAVA_HOME is jdk 17.0.1.

How can I resolve this error?

Vexea
  • 167
  • 1
  • 1
  • 8
  • Update gradle to 5 or higher – Nick Nov 02 '21 at 08:28
  • 3
    You might want to provide details on the error and your setup but my _guess_ would be that the version of gradle you're using doesn't know about Java 17 yet and thus if you tell it to use Java 17.0.1 it is confused. – Thomas Nov 02 '21 at 08:29
  • Does this answer your question? [Gradle: Could not determine java version from '11.0.2'](https://stackoverflow.com/questions/54358107/gradle-could-not-determine-java-version-from-11-0-2) – Karl Knechtel Nov 02 '21 at 08:30

1 Answers1

6

From official gradle doc:

A Java version between 8 and 16 is required to execute Gradle. Java 17 and later versions are not yet supported.

You need to downgrade you java to work with gradle .

UPDATED:

As gradle version 7.3 released at 5th Nov 2021 , It will now provide support to Java 17.

So you either upgrade to 7.3 gradle version or downgrade your java version .

George
  • 2,292
  • 2
  • 10
  • 21
  • 1
    And upgrade Gradle as well, Gradle 2.x only works with Java 8, for anything newer than Java 9, newer Gradle versions are necessary. – dunni Nov 02 '21 at 08:38
  • 1
    yes, exactly , buts its clear issue that there is no java 17 support yet , maybe just the release candidate [7.3-rc-1](https://docs.gradle.org/7.3-rc-1/release-notes.html) for now , and i strongly dont suggest that he try with . – George Nov 02 '21 at 08:41
  • Please don't answer questions that are blatant duplicates. Instead, vote to close as a duplicate. If you have additional information, you can add an answer, or a comment to an existing answer, on that question. – Karl Knechtel Nov 16 '21 at 21:28