【问题标题】:java.lang.IllegalAccessError in Atomic Kotlin Exercise Submissions原子 Kotlin 练习提交中的 java.lang.IllegalAccessError
【发布时间】:2021-07-07 16:48:10
【问题描述】:

我是学习 Kotlin 的新手,我在 Intellij Idea 中使用 EduTools 插件参加 Atomic Kotlin 课程

当我检查任何练习时(除了 hello,world 部分的练习 1-2),我遇到了这个错误:

Failed to launch checking

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':compileJava'.
java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x4a0535bd) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x4a0535bd

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.

Get more help at https://help.gradle.org

BUİLD FAILED in 1s

 Task :util:compileKotlin NO-SOURCE
 Task :util:compileJava NO-SOURCE
 Task :util:processResources NO-SOURCE
 Task :util:classes UP-TO-DATE
 Task :compileKotlin UP-TO-DATE
 Task :compileJava FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
2 actionable tasks: 1 executed, 1 up-to-date

尽管我的提交和答案相同,但检查失败。

我该如何解决这个问题?

我用:

  • IntelliJ IDEA 社区版 2021.1.3
  • Gradle v. 7.1.1
  • JDK v.16.0.1

【问题讨论】:

    标签: kotlin gradle intellij-idea


    【解决方案1】:

    尝试在Settings/Preferences | 中选择JDK 11 作为Gradle JVM构建、执行、部署 |构建工具 |摇篮。 此外,在 File | 中选择 JDK 11 作为 Project SDK。项目结构

    如果您没有,请按照here 的说明部署 JDK 11。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-28
      • 2019-01-17
      • 1970-01-01
      • 2013-03-07
      • 1970-01-01
      • 1970-01-01
      • 2018-01-13
      • 1970-01-01
      相关资源
      最近更新 更多