gradle build 发现jdk版本不一致导致

这篇具有很好参考价值的文章主要介绍了gradle build 发现jdk版本不一致导致。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'demo'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.4.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.1.4
      > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.4 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.2' but:
          - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.2')
          - Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.2')
          - Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.4 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.2')
          - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.4 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.2')
          - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.2')
          - Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.4 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.2')

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights

在项目中创建 gradle.properties 文件  配置jdk目录  文章来源地址https://www.toymoban.com/news/detail-840555.html

org.gradle.java.home=/usr/local/java/jdk-17

到了这里,关于gradle build 发现jdk版本不一致导致的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • gradle对应的jdk版本

    gradle和java一样,运行都要在jvm上运行,所以一般都会安装jdk供gradle运行,gradle和jdk的版本对应关系可以在gradle看到 https://gradle.org/install/ 可以看到gradle-8.5 需要jdk8及以上的运行环境,其他版本的我尝试看了下并没有Prerequistites, 其他版本的gradle肯定是有Prerequistites的,只是我没

    2024年03月21日
    浏览(45)
  • Android开发中Gradle插件,Gradle版本与JDK版本之间的对应关系

    Gradle插件 Gradle版本 SDK Build Tools JDK版本 说明 8.2 8.1 17 8.1 8.0 17 8.0 8.0 30.0.3 17 7.4 7.5 30.0.3 11 7.3 7.4 30.0.3 11 7.2 7.3.3 30.0.3 11 7.1 7.2 30.3.30 11 4.2.0+ 6.7.1 30.0.2 8+ 4.1.0+ 6.5+ 29.0.2 8+ 4.0.0+ 6.1.1+ 29.0.2 8+ 3.6.0~3.6.4 5.6.4+ 28.0.3 8+ 3.5.0 - 3.5.4 5.4.1+ 28.0.3 8+ 3.4.0 - 3.4.3 5.1.1+ 28.0.3 8+ 3.3.0 - 3.3.3 4.10.1+ 28.0

    2024年03月20日
    浏览(72)
  • android studio设置gradle和gradle JDK版本

    file - project structure - SDK Location - Gradle Settings - Gradle JDK - Download JDK file - project structure - Project

    2024年02月01日
    浏览(62)
  • Linux下JDK版本与安装版本不一致问题

    最近重新安装了centos7.9,针对以前遇到的Java版本不一致的情况, 提出了另一种方法,该方法简单易行,容易理解。 使用which java发现出来的是/usr/bin/java 进入到/usr/bin后查看,发现java是一个链接. 链接到了/etc/alternatives,如下: 而进入到/etc/alternatives下查看,发现java又是一个链接,如下:

    2024年02月16日
    浏览(34)
  • maven项目install报错,jdk版本不一致

    maven 项目install时报错org/springframework/boot/maven/RepackageMojo has been compiled by a more recent version of the Java Runtime(class file version 61.0),this of the Java Runtime only recognizes class file vesions up to 52.0 1.错误信息: maven 项目install时报错org/springframework/boot/maven/RepackageMojo has been compiled by a more recen

    2024年02月08日
    浏览(36)
  • grdle 的安装与配置 、gradle和jdk版本对应关系

    Java Gradle需要Java版本在8到19之间。目前还不支持Java 20及更高版本。 Java 6和Java 7仍然可以用于编译,但已经不适合用于测试。Gradle 9.0不支持Java 6和Java 7的测试。任何完全支持的Java版本都可以用于编译或测试。 然而,最新的Java版本可能只支持编译或测试,但还不支持运行Gra

    2024年02月11日
    浏览(56)
  • Android开发中,JDK版本,Gradle版本,Kotlin插件与Kotlin版本等各自对应关系

    一、Gradle版本和Java版本对应关系 二、Gradle版本和Kotlin版本对应关系 三、Gradle版本和Gradle插件版本匹配关系 可以在Android Studio的 File Project Structure Project 菜单中指定插件版本,也可以在顶级 build.gradle 文件中进行修改

    2024年03月15日
    浏览(68)
  • 开发Android App,令人头疼的Android Studio、Gradle、JDK、Andrroid Gradle Plugin版本问题

    开发Android App,各种报错。真是炼狱般的体验,一弄弄一天,一抬头半夜两点半,时间废了还没成果,真是服了。 记录下问题,便于后期查阅。 看到网友搞笑评论:Gradle 在不做人方面,一直很稳定 Android Studio 版本:Flamingo | 2022.2.1 Patch 1 默认支持的JDK: 默认自带的 JDK 17 创建

    2024年01月25日
    浏览(61)
  • Unity 2021版本,安卓打包时报错 Gradle build failed.See the console for details.

    Unity最后安卓打包时候,我打包失败,报错5个结果,参考很多博主方法后,已经解决了,故没有图。   解决方法:在排除了中文路径,Build System设置等问题后,我报这个错原因是安装的Android studio,Android studio在运行的时候也会在C盘生成一个.gradle文件,并且顶替了原有Unity打

    2024年02月11日
    浏览(55)
  • 【已解决】Ubuntu 20.04 编译OpenCV 动态链接库指向版本不一致导致出错

    问题:编译OpenCV 4.8.1, 显示出错: /usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to `ffi_type_uint32@LIBFFI_BASE_7.0\\\' /usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to `ffi_type_sint32@LIBFFI_BASE_7.0\\\' /usr/bin/ld: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined reference to

    2024年02月04日
    浏览(37)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包