Problem with Jenkins + SonarQube

The sonar.java.jdkHome property is only some extra information for the analysis.
But the analysis itself has to run with Java 17, when in your case it runs with Java 8 (class version 52.0)

You may use 2 Maven CLI commands like that, i.e.

this may run with Java 8 for compilation

withMaven(jdk: ..., maven: ..., globalMavenSettingsConfig: ...) {
  sh 'mvn clean install'
}

but this has to run with Java 17 and nodejs 20 is recommended

nodejs(configId: ..., nodeJSInstallationName: 'nodejs-20') {
  withSonarQubeEnv(...) {
    withMaven(jdk: 'java-17-openjdk', maven: ..., globalMavenSettingsConfig: ...) {
      sh 'mvn sonar:sonar'
    }
  }
}