I'm running a build using Gradle with open JDK 9.
The gradlew shadow command fails with the exception:
java.lang.IllegalAccessException: class org.gradle.api.internal.tasks.compile.reflect.SourcepathIgnoringInvocationHandler cannot access class com.sun.tools.javac.file.BaseFileManager (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.file to unnamed module @1c5af20
But I am running the java command with the option to export this module to all unnamed modules. My full java command:
exec /docker-java-home/bin/java --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED -Dorg.gradle.appname=gradlew -classpath /test/IotDevice/Applications/AppInsightsDocker/gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain --stacktrace shadow
Why am I still getting this exception?