https://kotlinlang.org logo
Title
j

jw

05/11/2023, 7:00 PM
How do I add the JDK classpath to a compiler configuration? I was calling
configureJdkClasspathRoots()
but it no-ops when the JDK is Java 9+, presumably due to the switch to modules and the disappearance of
rt.jar
. It seems like there's helpers for adding module roots given I know the path. Is it just my responsibility to do the JDK lookup, check for modular, and then conditionally do one or the other?
d

dmitriy.novozhilov

05/12/2023, 8:03 AM
In CLI mode filling the
CompilerConfiguration
is spread across a lot of different places, and it's hard to find all required places So I recommend to check JvmEnvironmentConfigurator class, which setups all required fields for configuration in tests (including different JDK) in one place