Gradlew stopped wroking after updating jdk
Dhruv00000 opened this issue ยท 7 comments
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.
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
.
Make sure your
JAVA_HOME
points to the folder that containsbin
(wherejavac
java
are) andjmods
folders. This folder is different from thebin
folder usually added toPATH
.
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.
Exactly: You need to set JAVA_HOME
to C:\Program Files\Java\jdk-16.0.1
. Notice there is no \bin
in the end!
Exactly: You need to set
JAVA_HOME
toC:\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
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
What's your gradle version? Make sure you are on gradle 7.0.2. I don't think older gradle works with older java.