10
11

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.

EclipseにてGradleのJAVA_HOME設定

Posted at

EclipseにてGradleのタスクを実行する際に、下記のようなエラーになってしまう場合があります。

What went wrong:
Execution failed for task ':modules:user.rest:compileJava'.
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_161 contains a valid JDK installation

原因はGradleのJAVA_HOMEが設定していないため、JREでビルドするからです。

Eclipse⇒Windowメニュー⇒Preference⇒Gradleにて「JAVA HOME」をJDKのパスを選択して設定すると解決となります。

image.png

全般ではなく、プロジェクトのタスクを実行する際にJAVA_HOMEを変更したい場合は下記にように操作できます。
タスク(例:deploy)に右クリック⇒Open Gradle Run Configuration...
image.png

以上

10
11
1

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
10
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?