Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing a Gradle project in IntelliJ using different java jdk version

Tags:

java

gradle

I tried to import a gradle project in IntelliJ and I'm getting the following error :

Error:Could not determine java version from '9.0.4'.

As said is the gradle project in java 1.8 ( exactly 1.8.0_152) and the version on my Linux is 9.0.4.

I think I should downgrade the version from 9.0.4 to this 1.8.0_152 but I don't know how to do it. Can I fix the problem without downgrading the Java version ?

like image 463
unnamed Avatar asked Jul 30 '26 11:07

unnamed


1 Answers

This is a well known bug! Here you can find the issue documentation with a possible solution on github: #16536

Edit the file /android/gradle/wrapper/gradle-wrapper.properties and update the last line with: distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip

Alternate I found this intellij specific solution, solved by pointing intellij at a location of a custom gradle install:

"File > Settings... > Build, Execution, Deployment > Gradle > Use local gradle distribution"
like image 95
0x1C1B Avatar answered Aug 02 '26 00:08

0x1C1B