please tell me how to solve this error

PS C:\Users\Александр Дайнека\IdeaProjects\Docker> ./mvnw clean package

Error: JAVA_HOME is set to an invalid directory.
JAVA_HOME = "C:\Program Files\Java\jdk-21\bin"
Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

Initially, I was told that I had no way to java home at all. After that, I downloaded the latest version of java, installed it and set the path. After that, this error started to come out

1

There are 1 best solutions below

0
On

JAVA_HOME is the root directiory of the java installation:

set %JAVA_HOME%="C:\Program Files\Java\jdk-21"