15
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MavenのJAVA_HOMEで躓いた時に見るメモ

Posted at

自分用にメモ

●動作環境
  • Winodws 10(Pro 64bit)
  • jdk-8u161(64bit)
  • Maven 3.5.2
●事象

Maven+Spring Bootで「mvn spring-boot:run」を実行したら次のエラーが発生

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
●原因

環境変数「JAVA_HOME」の設定ミス
JDKは、インストーラーに従ってインストールしたものの、環境変数のJAVA_HOMEが未設定のまま

●対応

JAVA_HOMEを次のように設定したら動いた

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_161

ちなみに、最初binまでパスを通していたが、mvn -vで確認したらまた怒られました

15
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?