LoginSignup
5
2

More than 1 year has passed since last update.

Java 17でSpring 3.0.6のプロジェクトをビルドしようとするとNo matching variant of org.springframework.bootのエラーが出る

Posted at

IntelliJ上でGradleビルドしようとしたら次のようなエラーが・・・

2023-04-22_17h15_15.png

Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.6.
No matching variant of org.springframework.boot

Spring Boot 3.0.6はJava 17以上が必要なのは知っていた。
build.gradle上にはJava 17と記載している。
プロジェクト設定もJava 17にしているのに何故かエラーが出る。

image.png

IntelliJのGradleの設定が間違っていた!

設定 > ビルド、実行、デプロイ > ビルドツール > Gradle にGradle JVMの設定箇所がありました。

image.png

ローカルのJava 11を使う設定がされていたのが原因でした・・・

ここをプロジェクトSDKを使うように設定を変えることで無事解決しました。

image.png

5
2
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
5
2