Reputation: 1
I am a newbie to learning Kotlin, and I take the Atomic Kotlin course in Intellij Idea with EduTools plugin
When I checking for any exercises(except exercise 1-2 in hello,world section), I encountered this error:
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
And check is failed, despite my submission and the answer are identical.
How can I fix this problem?
I use:
Upvotes: 0
Views: 1671
Reputation: 56
Try to select JDK 11 as Gradle JVM in Settings/Preferences | Build, Execution, Deployment | Build Tools | Gradle. Also, select JDK 11 as Project SDK in File | Project Structure.
If you don't have one, deploy JDK 11 as described here.
Upvotes: 1