So despite working fine previously when I try to execute my SpringBoot web application it instantly fails without printing any kind of exception. I have no idea what could have happened as I only made changes to some code adding comments and changing variable names.
Any help would be greatly appreciated, thanks.
Console output:
14:10:47: Executing task 'bootRun'...
14:10:47: Task execution finished 'bootRun'.
When I try to build:
14:14:13: Executing task 'build'..
14:14:13: Task execution finished 'build'.
Error with debug:
2021-08-18T19:56:05.305+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-08-18T19:56:05.305+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 2021-08-18T19:56:05.305+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2021-08-18T19:56:05.305+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 2021-08-18T19:56:05.305+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Java\jdk-11.0.5\bin\java.exe
You are passing a wrong
JAVA_HOME
to the build. That variable contains the path of the directory that contains the java compiler. If you have upgraded java, the correct value for this variable may have changed as it contains the version number.If you're starting the program from your IDE, please check your IDE settings. If you're starting it from the command line and passing
JAVA_HOME
explicitly, please verify that you're passing an existing directory. If you have a value set for the environment variableJAVA_HOME
, please verify that this is set to a valid location. See also WINDOWS 10 JAVA_HOME is not working