【问题标题】:What does "An illegal reflective access operation has occurred" with Kotlin, using IntelliJ IDEA, mean?使用 IntelliJ IDEA 的 Kotlin “发生了非法反射访问操作”是什么意思?
【发布时间】:2021-04-04 21:41:40
【问题描述】:

只需介绍 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 天时间尝试开始这件事,哈哈

【问题讨论】:

  • “到目前为止,花了 2 天时间尝试启动这件事”——这只是一个警告,不应阻止您的应用程序运行。它与 Java 9 中引入的 Java 平台模块系统 有关。以下是一些相关的问答:stackoverflow.com/questions/50251798/…stackoverflow.com/questions/46230413/…
  • 所以它仍然应该运行我的代码?但它没有,我做错了什么?
  • what did i do wrong? 您至少需要向我们展示您尝试运行的代码以及您获得的预期和实际结果。因为贴出来的输出和so it should still run my code? but it didnt的问题没有关系
  • 我不确定您可能做错了什么。你能提供一个minimal reproducible example 来证明这个问题吗?可能还有您正在使用的教程的链接?

标签: kotlin intellij-idea jetbrains-ide intellij-plugin


【解决方案1】:

我也有同样的问题。我尝试了kotlin compiler 的不同版本(1.4.32、1.4.31、1.4.20),它们在windows 上都有同样的问题。在Ubuntu 上,它们运行良好。无论如何,我在windows上安装了1.4.10版本,问题就解决了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-24
    • 2021-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    • 1970-01-01
    相关资源
    最近更新 更多