JDK9 -> java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

Building my project with Gradle. Build succeeds for Java8, but fails for Java9 with the
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.instantiateProcessor(AnnotationProcessingCompileTask.java:143)

Googling points to threads that seem to give answer for exactly this problem:

The solution is to add dependencies. But doing this does not solve the problem for me. Still getting the same error.
Also I am not sure to which dependencies section to add new dependancies. The exception happens in gradle, so it seems logical to add at buildscript->dependencies section. But this section only accepts classpath and not implementation as the above soultions suggest

From the exception, I looks like its an annotation processor failing to load. Which annotation processor(s) are you using?

Perhaps something like

dependencies {	
	annotationProcessor 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.2'
	testAnnotationProcessor 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.2'

Solved the problem. Several projects had
dataBinding {
enabled = true
in build.gradle. I do not use this functionality. After removing it from build.gradle, the project builds successfully.