Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not determine java version from '13.0.1'

I have gradle 6.0.1 and JDK 13.0.1 installed and tried gradlew setupDecompWorkspace, but it tells me "Could not determine java version from '13.0.1' ". I've tried to find an answer for a week now and I can't find a solution.

edit: the result of gradlew setupDecompWorkspace --stacktrace: https://pastebin.com/NFqZpBkG

edit 2: i manually changed the wrapper.properties file and updated my gradle wrapper. Now gradlew setupDecompWorkspace --stacktrace gives me this: https://pastebin.com/ubYj4Zq0

like image 652
jaliho Avatar asked Nov 20 '19 16:11

jaliho


2 Answers

I installed jdk 13 and call react-native run-android, then get error above.

Solution: Check if you have jdk 13 here: /Library/Java/JavaVirtualMachines/

ls /Library/Java/JavaVirtualMachines/

Then

cd /Library/Java/JavaVirtualMachines/
sudo rm -rf jdk-13.0.0 // your version

After that reinstall jdk-8 again.

like image 166
Tuan Nguyen Avatar answered Nov 11 '22 09:11

Tuan Nguyen


Gradle didn't support Java 13 (without forking the compiler) until Gradle 6.0. You say that is the one you have installed, but you are not supposed to install anything when using the Gradle wrapper. Rather, the wrapper will download the version of Gradle that is defined in the gradle-wrapper.properties file.

If you run gradlew --version (and remember to use the 'w' version), there is a good chance you will see an older version. If so, either upgrade the wrapper with gradle wrapper --gradle-version 6.0.1 --distribution-type all (or newer), or downgrade Java.

like image 37
Bjørn Vester Avatar answered Nov 11 '22 11:11

Bjørn Vester