How do I add the JDK classpath to a compiler confi...
# compiler
j
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
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