SonarQube support for OpenJDK 11

I have sent DM to you.Pls take a look and let me know.


Finally Its issue with Databinding with sonarcobe 7.9 version.Just integrated on some databinding sample code and seeing same issue JAXB Exception.
(FYI…With sample code which does not have data binding it works fine)

Unable to attache zip file.Can you pls let me know how to share sample code to reproduce the issue.


Hi Anil,

Based on the samples you sent me, I was able to reproduce the issue. I don’t see any relation with the sonarqube gradle plugin, and the error still happens after removing it from the build.

The android gradle plugin exposes an annotation processor that uses JAXB, and probably it doesn’t package it. This is not compatible with Java 11.

The error happens when gradle attempts to load JAXBException imported in this class:

I suggest you check with the maintainers of that plugin or downgrade the version of Java.

Hi Duarte,

Thanks for quick update.Without Sonarqube integration I was able to compile sample code also (Same with my project).After integration with Sonar I see this exception.

After removing Sonarcube integration, how did you compile to see this issue (android studio?)

Can you pls let me know which downgrade Java version will help to resolve this.I am ok to downgrade it.

In my opinion as this exception I am seeing during sonarcube exception, Is there anyway can you help to suppress it while doing Sonarcube scanner?

i.e with below command?

./gradlew clean sonarqube



The sonarqube tasks depends on compile and test tasks. See relevant code here:

Maybe a the failing task app:compileProdDebugJavaWithJavac is running because of this dependency, and would otherwise not run. You can try to run, without the sonarqube plugin, ./gradlew app:compileProdDebugJavaWithJavac and see if it works.
If that’s the problem, you could try to remove the problematic task dependency with something like sonarqube.dependsOn.remove("task-name").

I think JAXB was removed from JRE in Java 11, so downgrading to Java 8/9/10 should fix the problem.

Thanks Duarte.I tried below command for sonarcube and it generated report.
./gradlew clean app:compileProdDebugJavaWithJavac sonarqube

Though still could not understand app:compileProdDebugJavaWithJavac as arguments it solve the issue compare to previous command.
./gradlew clean sonarqube

Hello @akj,

I’m also having this same exact problem. I’ve configured my Gradle files the same way you did, Added JAX-B dependencies also.

But executing the above command I’m getting the following Exception:

What went wrong:
Task ‘compileProdDebugJavaWithJavac’ not found in project ‘:app’.

Could you please help me with this. I’m trying to solve this problem from 2 days now :expressionless:


Hello @dmeneses

Following command is not working, can you help me with this please?

Getting Following Exception
What went wrong:
Task ‘compileProdDebugJavaWithJavac’ not found in project ‘:app’.

Hi. Please post the full stack trace of the exception.

Hello @dmeneses, thanks for the quick reply, when I added the plugin with sonar properties and executed with this command:

gradlew.bat clean sonarqube

I get this following exception:

  > Task :app:kaptDebugKotlin FAILED
e: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
        at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredConstructors(
        at java.base/java.lang.Class.getConstructor0(
        at java.base/java.lang.Class.newInstance(
        at org.jetbrains.kotlin.cli.jvm.plugins.ServiceLoaderLite.loadImplementations(ServiceLoaderLite.kt:51)
        at org.jetbrains.kotlin.cli.jvm.plugins.ServiceLoaderLite.loadImplementations(ServiceLoaderLite.kt:44)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension$loadProcessors$efficientProcessorLoader$1.doLoadProcessors(Kapt3Extension.kt:83)
        at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors(ProcessorLoader.kt:45)
        at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors$default(ProcessorLoader.kt:28)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.loadProcessors(Kapt3Extension.kt:88)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:171)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:98)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:95)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:105)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:80)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:398)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:65)
        at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:107)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:389)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:118)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:166)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:56)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:442)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:102)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:1005)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:102)
        at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:138)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:1047)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:1004)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:441)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.base/java.lang.reflect.Method.invoke(
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(
        at java.rmi/sun.rmi.transport.Transport$
        at java.rmi/sun.rmi.transport.Transport$
        at java.base/ Method)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(
        at java.base/ Method)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.base/java.util.concurrent.ThreadPoolExecutor$
        at java.base/
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
        at java.base/
        at java.base/java.lang.ClassLoader.loadClass(
        at java.base/java.lang.ClassLoader.loadClass(
        ... 50 more

So I added following JAX-B libraries into Build.gradle:

implementation "javax.xml.bind:jaxb-api:2.3.1"
implementation "com.sun.xml.bind:jaxb-core:"
implementation "com.sun.xml.bind:jaxb-impl:2.3.2"
implementation "javax.activation:activation:1.1.1"

After this If I use same command:

gradlew.bat clean sonarqube

I get the following error:

> Task :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> javax/xml/bind/JAXBException

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.

25 actionable tasks: 24 executed, 1 up-to-date

It is somewhat same as what @akj found, but I’m not able to solve this. Could you tell me what am I doing wrong?


Hello @dmeneses
I think it is happening because of the data binding I’m using, as I’ve read it above in some of @akj posts. But I’m not sure. Do you think there’s any solution to this?? Or should I just give up :zipper_mouth_face: