Fabric API

Fabric API

106M Downloads

Gradlew stopped wroking after updating jdk

Dhruv00000 opened this issue ยท 7 comments

commented

I updated my jdk version yesterday and now when i do gradlew build, it gives me an error saying that the JAVA_HOME environment variable is wrong but i changed the variable to the new jdk installaion directory.

commented

Make sure your JAVA_HOME points to the folder that contains bin (where javac java are) and jmods folders. This folder is different from the bin folder usually added to PATH.

commented

Make sure your JAVA_HOME points to the folder that contains bin (where javac java are) and jmods folders. This folder is different from the bin folder usually added to PATH.

It still gives me the error:

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk-16.0.1\bin

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

commented

Exactly: You need to set JAVA_HOME to C:\Program Files\Java\jdk-16.0.1. Notice there is no \bin in the end!

commented

Exactly: You need to set JAVA_HOME to C:\Program Files\Java\jdk-16.0.1. Notice there is no \bin in the end!

It still gives the exact same error bu with a different path

commented

Hmm, then you need to install gradle locally (add to your path) and run gradle wrapper --gradle-version 7.0.2 in your project so gradle can put the right wrapper in your project and you can do ./gradlew commands properly

commented

What's your gradle version? Make sure you are on gradle 7.0.2. I don't think older gradle works with older java.

commented

What's your gradle version? Make sure you are on gradle 7.0.2. I don't think older gradle works with older java.

When I try to check my gradlew version the error pops up, I am using gradlew -v to check it