Can sonarqube10.4 support Java8 version of business project scanning?

The following steps when trying to build SonarLint from source lead to an error:

mvn clean verify sonar:sonar \                                       
  -Dsonar.projectKey=dp-item-ao \
  -Dsonar.projectName='dp-item-ao' \
  -Dsonar.host.url=http://localhost:9000 \
  -Dsonar.token=sqp_4bc19cd64175a05fcfccf1292a888e8ab73e875c -Dsonar.java.jdkHome=/Users/guoqingdong/lib/jdk-17.0.10.jdk/Contents/Home

This is the error one runs in to:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar (default-cli) on project dp-rank-ao-parent: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:3.10.0.2594
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/guoqingdong/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.10.0.2594/sonar-maven-plugin-3.10.0.2594.jar
[ERROR] urls[1] = file:/Users/guoqingdong/.m2/repository/org/codehaus/plexus/plexus-sec-dispatcher/2.0/plexus-sec-dispatcher-2.0.jar
[ERROR] urls[2] = file:/Users/guoqingdong/.m2/repository/org/codehaus/plexus/plexus-utils/3.4.1/plexus-utils-3.4.1.jar
[ERROR] urls[3] = file:/Users/guoqingdong/.m2/repository/org/codehaus/plexus/plexus-cipher/2.0/plexus-cipher-2.0.jar
[ERROR] urls[4] = file:/Users/guoqingdong/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.3.1081/sonar-scanner-api-2.16.3.1081.jar
[ERROR] urls[5] = file:/Users/guoqingdong/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
guoqingdong@guoqingdongdeMacBook-Pro dp-rank-ao % vim ~/.bash_profile

the test project JDK version is 8. Can sonarqube10.4 support Java8 version of business project scanning?

Hey there.

Take a look at the Scanner Environment documentation – basically, you should build with Java 8 but analyze with Java 17.