DEV Community

Discussion on: Java Enterprise 101: Building a REST Server with Spring Boot

Collapse
 
martinhaeusler profile image
Martin Häusler

So usually this error means that gradle cannot find your Java Compiler, either because it is not installed at all or your PATH variable (windows) or JAVA_HOME (windows + linux) is not set up properly.

Try running javac -version in the same shell you are running your gradle command in to see what version of the Java Compiler is being called. If that command produces an error, you know that the JDK is not set up properly or not properly registered with the OS. On windows, it usually suffices to add the path to the JDK installation to the PATH environment variable. As for Linux and Mac, sorry I don't know; but Google / Stackoverflow should hold the answer for that.

Collapse
 
hcnenseth profile image
Hans Christian Nenseth • Edited

Hmmm.. doesnt seem to be the problem.
It finds javac 10.0.1

Thanks for the quick reply by the way!!

Thread Thread
 
martinhaeusler profile image
Martin Häusler

Ok then it is very likely the JAVA_HOME environment variable that is not set up. Gradle is unfortunately rather picky when it comes to the setup and the environment variables. Here's a tutorial on how to set it up on windows (as you use the *.bat file I assume that is what you need):

mkyong.com/java/how-to-set-java_ho...

If that still doesn't work, feel free to try Maven instead; for this tutorial it really does not matter.