Replace --illegal-access workaround with --add-exports

--illegal-access=permit doesn't work since JDK 17.

 #KT-47152 Fixed
This commit is contained in:
Alexander Udalov
2021-07-23 20:55:53 +02:00
parent a44048e713
commit 698c0bb2a9
@@ -377,7 +377,7 @@ object KotlinCompilerClient {
val javaVersion = CompilerSystemProperties.JAVA_VERSION.value?.toIntOrNull()
val javaIllegalAccessWorkaround =
if (javaVersion != null && javaVersion >= 16)
listOf("--illegal-access=permit")
listOf("--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED")
else emptyList()
val args = listOf(
javaExecutable.absolutePath, "-cp", compilerId.compilerClasspath.joinToString(File.pathSeparator)) +