Could not determine java version from '9.0.1'

@to175 In your post (Could not determine java version from '9.0.1') you show a snippet from your gradle/wrapper/gradle-wrapper.properties file:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-src.zip

The last line (distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-src.zip) points to the source distribution (note the -src). This distribution cannot be used to run Gradle.
You need to change -src to -bin (or -all) to be able to launch Gradle via the wrapper.

BUILD SUCCESSFUL in 41s
7 actionable tasks: 7 executed

Thanks a lot

Nice! Sorry about the src versus bin thing; I didn’t have that issue.

BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed

For me the problem was solved by selecting the 9.0.1 JDK in File>Project Settings>SDK.

Good night.

Upgrading to JDK 10 is also an option when you need to use Gradle 4.1… :slight_smile:

Same problem here. I use eclipse on a windows 10 machine with the gradle wrapper and the buildship plugin.

gradlew.bat --version gives me:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/Users/brand/.gradle/wrapper/dists/gradle-4.3.1-bin/7yzdu24db77gi3zukl2a7o0xx/gradle-4.3.1/lib/groovy-all-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.3.1
------------------------------------------------------------

Build time:   2017-11-08 08:59:45 UTC
Revision:     e4f4804807ef7c2829da51877861ff06e07e006d

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          9.0.1 (Oracle Corporation 9.0.1+11)
OS:           Windows 10 10.0 amd64

So I already updated to 4.3.1.
Is my eclipse somehow not using it?

Like said above, you need to update the wrapper itself, too, by running ./gradlew wrapper --gradle-version 4.3.1 twice.

I have the same issue with Eclipse Oxygen and Gradle (STS) plugin. I have Oracle Java 9.0.1 and gradle 4.3.1 and the wrapper. I’ve run gradlew wrapper --gradle-version 4.3.1 --no-daemon twice but I still get the following error in Eclipse:

An internal error occurred during: “Convert to Gradle project”.
Could not determine java version from ‘9.0.1’.

The gradle.wrapper.properties file looks fine:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

Could you help?

Thanks

Hello. My gradle info is:

Gradle 4.4

Build time: 2017-12-06 09:05:06 UTC
Revision: cf7821a6f79f8e2a598df21780e3ff7ce8db2b82

Groovy: 2.4.12
Ant: Apache Ant™ version 1.9.9 compiled on February 2 2017
JVM: 9.0.1 (Oracle Corporation 9.0.1+11)
OS: Mac OS X 10.12.6 x86_64

I then did:
gradle wrapper --gradle-version 4.4 --no-daemon

I got
BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed

And did
./gradlew wrapper --gradle-version 4.4 --no-daemon
Downloading https://services.gradle.org/distributions/gradle-4.4-bin.zip
BUILD SUCCESSFUL in 9s
1 actionable task: 1 up-to-date

I have since ran this multiple times:
./gradlew wrapper --gradle-version 4.4 --no-daemon

as I run
./build-all-projects.sh

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine java version from ‘9.0.1’.

I am trying to build this project:

Not certain what to do. Thank you

The repository you are referencing contains 9 Gradle wrappers, one in each subfolder. You need to update every single one of them…

I don’t think the Gradle STS plugin works with Java 9. Could you try Buildship instead?

I have upgraded my gradle and i still have the same issue.

1 Like

Could you open an issue for this? Please provide all the information in the issue template.

upgrade did not fix the issue, linux mint 18.3

Gradle 4.4.1

Build time: 2017-12-20 15:45:23 UTC
Revision: 10ed9dc355dc39f6307cc98fbd8cea314bdd381c

Groovy: 2.4.12
Ant: Apache Ant™ version 1.9.9 compiled on February 2 2017
JVM: 9.0.1 (Oracle Corporation 9.0.1+11)
OS: Linux 4.13.0-26-generic amd64

I found out that the error goes away if I pick the profile=web. example:
grails create-app Example --profile=web
leaving the profile option off lead to the error listed on this page for me.

@jessewriter If running on Java 9 does not work for Gradle 4.4.1 or a Gradle wrapper generated by Gradle 4.4.1 then please open an issue on Github. Please provide the necessary information to reproduce the problem in the issue.

In windows, it worked for me to change the environment variable of the jdk.
http://bryanlor.com/blog/gradle-tutorial-how-install-gradle-windows

I have the same issue. Please help.

I found this post: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000029630-Please-update-Gradle-plugin-for-latest-

In IntelliJ, using a gradle wrapper configuration (even if gradle wrapper --gradle-version=4.5.1) with 9.0.4 does not seem to work. It worked for me when choosing a local gradle distribution (4.5.1).

1 Like

Using a local installation worked for me. Thanks!