I am having a lot of trouble for what should be an easy task. I'm trying to build a simple Java project (just Hello World) with Gradle for one of my courses before classes begin. I cloned the repository, downloaded all the relevant software, and tried gradle build
on the command line. I get the error Supplied javaHome must be a valid directory. You supplied: C:\Program Files\AdoptOpenJDK\jre-8.0.282.8-hotspot
. This file that shows up was a previous version that I had removed.
I tried reinstalling everything, and I also checked the JAVA_HOME environment variable, which is set to C:\Program Files\AdoptOpenJDK\jdk-15.0.2.7-hotspot\
. I've also relaunched the terminal and rebooted my computer. I'm using Git Bash as my shell, if that's anything relevant. Any advice on how to change the supplied javaHome?
Here are some relevant screenshots:
JAVA_HOME environment variable
My (very sketchy) solution is to make a copy of the existing jre15 folder I have and rename it to jre-8.0.282.8-hotspot
. I can build and run my program now, but it just seems very sketch.
One year update: I asked my prof when classes started when he said this solution was actually pretty ok and would suffice for the semester.