CLI: suppress warning on JDK 9+ with illegal access to ResourceBundle

The underlying issue is tracked in IDEA-248785.

 #KT-43704 Fixed
This commit is contained in:
Alexander Udalov
2021-01-07 22:26:43 +01:00
parent 2ef4ca4e6e
commit f08733eb75
3 changed files with 33 additions and 7 deletions
+10 -4
View File
@@ -40,14 +40,20 @@ shift
goto loop
:loopend
if "%_KOTLIN_RUNNER%"=="1" (
java %JAVA_OPTS% "-Dkotlin.home=%_KOTLIN_HOME%" -cp "%_KOTLIN_HOME%\lib\kotlin-runner.jar" ^
setlocal EnableDelayedExpansion
call :set_java_version
if !_java_major_version! geq 9 (
rem Workaround the illegal reflective access warning from ReflectionUtil to ResourceBundle.setParent, see IDEA-248785.
set JAVA_OPTS=!JAVA_OPTS! "--add-opens" "java.base/java.util=ALL-UNNAMED"
)
if "!_KOTLIN_RUNNER!"=="1" (
java !JAVA_OPTS! "-Dkotlin.home=%_KOTLIN_HOME%" -cp "%_KOTLIN_HOME%\lib\kotlin-runner.jar" ^
org.jetbrains.kotlin.runner.Main %KOTLIN_OPTS%
) else (
setlocal EnableDelayedExpansion
set _ADDITIONAL_CLASSPATH=
call :set_java_version
if !_java_major_version! lss 13 (
set JAVA_OPTS=!JAVA_OPTS! "-noverify"
)