How do i pass a sonar parameter to use java11 to scan the code?

My code will compile with jdk8 and i need to update sonarscanner to use java11.
In the base docker image iam planing to have 2 java versions so how do i tell sonar scanner to use specific version of java?
we are using Gradle wrapper and we have base image which containes java and gradle installation. it is taking java version from base image for compiling the code and scanning the code. if install only java11 below error iam getting at runtime becasue runtime image having java8.

**Exception in thread “main” java.lang.UnsupportedClassVersionError: com/mna/application/Application has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

if i install java8 and java11 and give JAVA_HOME points to jdk8…does it work? How do i tell sonar to use specific version for java?

Hi @js-techie,

You should find all the details you need in this SonarCloud documentation.

Regards,

Cameron.