java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException for JDK9

Building my project with Gradle. For Java8 build passes, for Java9 it fails with
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.instantiateProcessor(

Googling leads to discussions that seem to provide the exact solution of the problem:

But adding the dependencies as described in above threads does not solve the problem for me. Still getting same error.
I can see that the exception happens in gradle, so I assume that the dependencies need to be added in buildscript->dependencies section, but this section seems to accept only classpath and not implementation.

In short - confused. Will appreciate help.