发生了非法的反射访问操作
An illegal reflective access operation has occurred
我正在尝试在 Visual Studio 代码中使用 Kotlin。我刚刚选择完环境路径,但是当我尝试 运行 程序时,我每次都会收到此警告:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil 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
如果我尝试 运行
--illegal-access=deny
我收到以下错误:
error: unresolved reference: illegal
--illegal-access=deny
^
error: variable expected
--illegal-access=deny
^
error: unresolved reference: access
--illegal-access=deny
^
error: unresolved reference: deny
--illegal-access=deny
我是个新手,我该如何解决这个问题?
感谢您的每一个回答!
我知道这很烦人,但是,这实际上不是您需要担心的事情。您可以 运行 您的程序带有标志,而不必太担心警告。有关更深入的详细信息,有许多资源(例如 https://www.logicbig.com/tutorials/core-java-tutorial/modules/illegal-access-operations.html)提供了更详细的信息。它更多的是促使图书馆作者采取行动而不是其他任何事情。
需要将标志传递给执行程序的java命令
例如java --illegal-access=deny --module-path <path> --module <module>/<main-class> [args...]
我正在尝试在 Visual Studio 代码中使用 Kotlin。我刚刚选择完环境路径,但是当我尝试 运行 程序时,我每次都会收到此警告:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil 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
如果我尝试 运行
--illegal-access=deny
我收到以下错误:
error: unresolved reference: illegal
--illegal-access=deny
^
error: variable expected
--illegal-access=deny
^
error: unresolved reference: access
--illegal-access=deny
^
error: unresolved reference: deny
--illegal-access=deny
我是个新手,我该如何解决这个问题? 感谢您的每一个回答!
我知道这很烦人,但是,这实际上不是您需要担心的事情。您可以 运行 您的程序带有标志,而不必太担心警告。有关更深入的详细信息,有许多资源(例如 https://www.logicbig.com/tutorials/core-java-tutorial/modules/illegal-access-operations.html)提供了更详细的信息。它更多的是促使图书馆作者采取行动而不是其他任何事情。
需要将标志传递给执行程序的java命令
例如java --illegal-access=deny --module-path <path> --module <module>/<main-class> [args...]