「ERROR: JAVA_HOME is set to an invalid directory.」の対処法を解説します。
「ERROR: JAVA_HOME is set to an invalid directory.」が出た
コマンドプロンプトで、以下コマンドを実行すると
mvnw package
以下のエラーが表示されました。
ERROR: JAVA_HOME is set to an invalid directory.
JAVA_HOME = “C:\Program Files\Eclipse Adoptium\jdk-21.0.1.12-hotspot\”
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
JAVA_HOME = “C:\Program Files\Eclipse Adoptium\jdk-21.0.1.12-hotspot\”
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
![](https://ootkblog.com/wp-content/uploads/2024/02/error-java_home-is-set-to-an-invalid-directory-1.png)
「ERROR: JAVA_HOME is set to an invalid directory.」の対処法
もう一度、Javaをインストールすると正常に動作しました。
![](https://ootkblog.com/wp-content/uploads/2024/02/error-java_home-is-set-to-an-invalid-directory-2.png)