TestNG build failing with JDK9 Jigsaw due to Gradle

Alan Bateman Alan.Bateman at oracle.com
Sat Oct 31 13:56:20 UTC 2015


On 31/10/2015 12:50, Mani Sarkar wrote:
> Hi Rory,
>
> Do you know of a version of Gradle or a EA version which is JDK 9 
> Jigsaw compatible, we get these failures when building:
>
> https://adopt-openjdk.ci.cloudbees.com/view/Quality%20Outreach/job/TestNG-Jigsaw/5/console
>
Caused by: java.lang.IllegalAccessException: class 
org.gradle.internal.reflect.DirectInstantiator cannot access class 
com.sun.tools.javac.api.JavacTool (in module jdk.compiler) because 
module jdk.compiler does not export package com.sun.tools.javac.api to 
<unnamed module @b7f23d9>
     at 
org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:49)
     ... 86 more

We should at least check if there is a bug in the Gradle JIRA for this. 
It can be worked around by configuring the compileJava options to fork 
javac but you might not want to do that.

The other issue with Gradle that we know about is the ClassCastException 
when attempting to run tests, this is tracked here:
     https://issues.gradle.org/browse/GRADLE-3287

-Alan.



More information about the jigsaw-dev mailing list