I tried to add the following to the root build.gradle file:
subprojects {
gradle.projectsEvaluated {
tasks.withType(Compile) {
I had a different compilation argument to set. The following works for me.
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-XDignore.symbol.file"
options.bootClasspath = "$System.env.JAVA_HOME/jre/lib/rt.jar"
}
}
You have to set the boot classpath for JDK 1.8 and above for things like Unsafe and sun.swing.* classes. Fix the source code especially for the latter, because Jigsaw Java 9, the up and coming modularity implementation for the JRE, will finally make these methods inaccessible(!). Consider yourself warned.