[z]spring boot gradle build

时间:2022-05-21 19:18:15

I had the same problem. I believe it is caused by the JRE that gradle is configured to use rather than the eclipse/STS JRE. On my machine, gradle had defaulted to using the wrong JRE. When gradle is installed (even via buildship) it puts a .gradle directory in your home directory (C:/Users/username) on Windows. You can create a gradle.properties file in .gradle and specify the JRE/JDK you want gradle to use as in this example:

org.gradle.java.home=C:/Program Files/Java/jdk1.8.0

This would probably be revealed by using the command line approach recommended by robyjwilkins. It should avoid the need to re-install a JDK.

For more information see https://docs.gradle.org/current/userguide/build_environment.html