You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行gradlew.bat遇NoClassDefFoundError及Gradle缓存问题求助

Gradle执行gradlew.bat时的系列错误排查问题

初始错误

执行gradlew.bat时触发以下错误:

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]

已尝试的操作及后续问题

  • 修改gradle-wrapper.properties中的distributionUrl配置:
    原内容:

    distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
    

    修改为:

    distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
    

    重新执行后出现新错误:

    A problem occurred configuring root project 'nexus-deploy'.
    > Could not open cp_proj remapped class cache for s5e1jtxdcnwfq13zlj7qke7c
    
  • 删除Gradle缓存目录下的scripts和scripts-remapped文件夹,问题未解决。

  • 执行命令./gradlew clean,仍出现相同缓存错误:

    * What went wrong:
    A problem occurred configuring root project 'nexus-deploy'.
    Could not open cp_proj remapped class cache for s5e1jtxdcnwfq13zlj7qke7c
    

环境信息

  • Java版本:1.8.0_341
  • Gradle版本:7.5.1

内容的提问来源于stack exchange,提问作者Barry

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 08:50:28