使用 IntelliJ IDEA 的 Kotlin 的“发生非法反射访问操作”是什么意思?

问题描述

简单介绍一下 JetBrains,Hello World。

这一切意味着什么?安装问题?我不得不下载许多不同版本的东西。

-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\lib\idea_rt.jar=52283:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\bin" -Dfile.encoding=windows-1252 -classpath C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc\lib\kotlin-compiler.jar;C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc\lib\kotlin-reflect.jar;C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc\lib\kotlin-stdlib.jar;C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc\lib\kotlin-script-runtime.jar org.jetbrains.kotlin.cli.jvm.K2JVMCompiler -kotlin-home C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc -script C:/Users/Student-CHCS201/IdeaProjects/FirstExample/src/Main.kts
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil (file:/C:/Users/Student-CHCS201/AppData/Roaming/JetBrains/IntelliJIdea2020.3/plugins/Kotlin/kotlinc/lib/kotlin-compiler.jar) to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

到目前为止花了 2 天时间尝试开始这件事,哈哈

解决方法

我也遇到了同样的问题。我尝试了 kotlin compiler 的不同版本 (1.4.32,1.4. 31,1.4.20),它们在 windows 上都有相同的问题。在 Ubuntu 上,它们完美运行。不管怎样,我在windows上安装了1.4.10版本,问题解决了。