https://kotlinlang.org logo
#kotest
Title
# kotest
d

Dan T

02/15/2022, 2:50 PM
I hit the strong encapsulation issue using the system extension
withEnvironment
on JDK 17.
java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Map java.util.Collections$UnmodifiableMap.m accessible
at
SystemEnvironmentExtensions.kt:115
. I can get around the issue by adding
--add-opens java.base/java.util=ALL-UNNAMED
, but I'm wondering if there's a different path forward for this feature that doesn't require the workaround.?
s

sam

02/15/2022, 2:52 PM
Until the JDK offers some way of modifying the env vars at runtime, that is the only way to do it.
🙏 1
36 Views