11
4

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 1 year has passed since last update.

Gradleプロジェクトインポート時のエラー対応メモ

Last updated at Posted at 2022-12-04

概要

STS環境にてGradleプロジェクトをインポートする際にエラーが発生した。
その際の解決メモ

環境

Windows 11
Open JDK11 (11.0.2)
Spring Tools Suite4 Eclipse (4.16.1)
Gradle (6.7)

行おうとしたこと

他所から貰ったGradleプロジェクトをローカルにインポートしようとした

発生した課題

インポート時に以下のエラーメッセージが表示していた

org.gradle.tooling.BuildException: Could not fetch model of type 'GradleBuild' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-6.7-bin.zip'.

思った事

JDK11にてGradleのバージョンが対応されていないか、STS環境設定回りとしてJDKのパス設定がどこか足りないか

参考にさせて頂いた記事

EclipseにてGradleのJAVA_HOME設定

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

解決メモ

Gradleインポート時のオプション設定で[Java home]を指定する箇所が有ります。

JDKのパス設定は対応済みでしたが、ここでも明示的に設定する事とします。
image.png

結果

エラーを解消出来ました。
image.png

後記 インポートがいつまで待っても終わらない

インポートエラーは解消できましたが、インポート処理が15分近く待っても終わりませんでした。
[Offline Mode]にチェックを入れる事で解消しました。

image.png

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?