Maven Sonar error ClassFormatError accessible: module java.base does not "opens java.lang" to unname

I am running Maven Sonar plugin 3.9.1.2184 on

  • Apache Maven 3.9.2 (c9616018c7a021c1c39be70fb2843d6f5f9b8a1c)
  • Java version: 17.0.7, vendor: Amazon.com Inc., runtime: /usr/lib/jvm/java-17-amazon-corretto
  • OS name: “linux”, version: “5.4.231-137.341.amzn2.x86_64”, arch: “amd64”, family: “unix”
  • SonarQube Enterprise Edition Version 8.9.9 (build 56886)

It fails with error:

195956 [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project bar: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.lang.ExceptionInInitializerError: null
195956 [ERROR] -----------------------------------------------------
195956 [ERROR] realm =    plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184
195956 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
195956 [ERROR] urls[0] = file:/tmp/foo/bar/.mvn/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
195956 [ERROR] urls[1] = file:/tmp/foo/bar/.mvn/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
195956 [ERROR] urls[2] = file:/tmp/foo/bar/.mvn/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
195956 [ERROR] urls[3] = file:/tmp/foo/bar/.mvn/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
195956 [ERROR] urls[4] = file:/tmp/foo/bar/.mvn/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
195956 [ERROR] urls[5] = file:/tmp/foo/bar/.mvn/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
195956 [ERROR] Number of foreign imports: 1
195956 [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
195956 [ERROR] 
195956 [ERROR] -----------------------------------------------------: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @4e3bd3ef
195956 [ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project bar: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.lang.ExceptionInInitializerError: null
-----------------------------------------------------
realm =    plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/tmp/foo/bar/.mvn/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
urls[1] = file:/tmp/foo/bar/.mvn/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
urls[2] = file:/tmp/foo/bar/.mvn/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[3] = file:/tmp/foo/bar/.mvn/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
urls[4] = file:/tmp/foo/bar/.mvn/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
urls[5] = file:/tmp/foo/bar/.mvn/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
-----------------------------------------------------
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:347)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.lang.ExceptionInInitializerError: null
-----------------------------------------------------
realm =    plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/tmp/foo/bar/.mvn/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
urls[1] = file:/tmp/foo/bar/.mvn/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
urls[2] = file:/tmp/foo/bar/.mvn/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[3] = file:/tmp/foo/bar/.mvn/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
urls[4] = file:/tmp/foo/bar/.mvn/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
urls[5] = file:/tmp/foo/bar/.mvn/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
-----------------------------------------------------
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.PluginContainerException: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.lang.ExceptionInInitializerError: null
-----------------------------------------------------
realm =    plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/tmp/foo/bar/.mvn/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
urls[1] = file:/tmp/foo/bar/.mvn/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
urls[2] = file:/tmp/foo/bar/.mvn/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[3] = file:/tmp/foo/bar/.mvn/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
urls[4] = file:/tmp/foo/bar/.mvn/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
urls[5] = file:/tmp/foo/bar/.mvn/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
-----------------------------------------------------
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:163)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.ExceptionInInitializerError
    at com.sonar.sslr.api.typed.ActionParser.<init> (ActionParser.java:59)
    at org.sonar.json.parser.JSONParserBuilder.createParser (JSONParserBuilder.java:47)
    at org.sonar.json.parser.JSONParserBuilder.createParser (JSONParserBuilder.java:36)
    at org.sonar.plugins.json.JSONSquidSensor.<init> (JSONSquidSensor.java:85)
    at org.sonar.plugins.json.JSONSquidSensor.<init> (JSONSquidSensor.java:75)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstanceWithCaller (Constructor.java:499)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:480)
    at org.picocontainer.injectors.AbstractInjector.newInstance (AbstractInjector.java:145)
    at org.picocontainer.injectors.ConstructorInjector$1.run (ConstructorInjector.java:342)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe (AbstractInjector.java:270)
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance (ConstructorInjector.java:364)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance (AbstractInjectionFactory.java:56)
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance (AbstractBehavior.java:64)
    at org.picocontainer.behaviors.Stored.getComponentInstance (Stored.java:91)
    at org.picocontainer.DefaultPicoContainer.getLocalInstance (DefaultPicoContainer.java:606)
    at org.picocontainer.DefaultPicoContainer.getComponents (DefaultPicoContainer.java:587)
    at org.sonar.core.platform.ComponentContainer.getComponentsByType (ComponentContainer.java:291)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.completeScannerExtensions (AbstractExtensionDictionnary.java:82)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getExtensions (AbstractExtensionDictionnary.java:77)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getFilteredExtensions (AbstractExtensionDictionnary.java:67)
    at org.sonar.scanner.sensor.ModuleSensorExtensionDictionnary.selectSensors (ModuleSensorExtensionDictionnary.java:40)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$0 (ModuleSensorsExecutor.java:52)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:52)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:392)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:388)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:385)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:357)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:150)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:72)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:66)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at jdk.proxy7.$Proxy71.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @4e3bd3ef
    at net.sf.cglib.core.ReflectUtils.defineClass (ReflectUtils.java:464)
    at net.sf.cglib.core.AbstractClassGenerator.generate (AbstractClassGenerator.java:336)
    at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply (AbstractClassGenerator.java:93)
    at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply (AbstractClassGenerator.java:91)
    at net.sf.cglib.core.internal.LoadingCache$2.call (LoadingCache.java:54)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at net.sf.cglib.core.internal.LoadingCache.createEntry (LoadingCache.java:61)
    at net.sf.cglib.core.internal.LoadingCache.get (LoadingCache.java:34)
    at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData.get (AbstractClassGenerator.java:116)
    at net.sf.cglib.core.AbstractClassGenerator.create (AbstractClassGenerator.java:291)
    at net.sf.cglib.core.KeyFactory$Generator.create (KeyFactory.java:221)
    at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:174)
    at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:153)
    at net.sf.cglib.proxy.Enhancer.<clinit> (Enhancer.java:73)
    at com.sonar.sslr.api.typed.ActionParser.<init> (ActionParser.java:59)
    at org.sonar.json.parser.JSONParserBuilder.createParser (JSONParserBuilder.java:47)
    at org.sonar.json.parser.JSONParserBuilder.createParser (JSONParserBuilder.java:36)
    at org.sonar.plugins.json.JSONSquidSensor.<init> (JSONSquidSensor.java:85)
    at org.sonar.plugins.json.JSONSquidSensor.<init> (JSONSquidSensor.java:75)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstanceWithCaller (Constructor.java:499)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:480)
    at org.picocontainer.injectors.AbstractInjector.newInstance (AbstractInjector.java:145)
    at org.picocontainer.injectors.ConstructorInjector$1.run (ConstructorInjector.java:342)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe (AbstractInjector.java:270)
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance (ConstructorInjector.java:364)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance (AbstractInjectionFactory.java:56)
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance (AbstractBehavior.java:64)
    at org.picocontainer.behaviors.Stored.getComponentInstance (Stored.java:91)
    at org.picocontainer.DefaultPicoContainer.getLocalInstance (DefaultPicoContainer.java:606)
    at org.picocontainer.DefaultPicoContainer.getComponents (DefaultPicoContainer.java:587)
    at org.sonar.core.platform.ComponentContainer.getComponentsByType (ComponentContainer.java:291)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.completeScannerExtensions (AbstractExtensionDictionnary.java:82)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getExtensions (AbstractExtensionDictionnary.java:77)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getFilteredExtensions (AbstractExtensionDictionnary.java:67)
    at org.sonar.scanner.sensor.ModuleSensorExtensionDictionnary.selectSensors (ModuleSensorExtensionDictionnary.java:40)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$0 (ModuleSensorsExecutor.java:52)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:52)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:392)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:388)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:385)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:357)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:150)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:72)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:66)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at jdk.proxy7.$Proxy71.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @4e3bd3ef
    at java.lang.reflect.AccessibleObject.checkCanSetAccessible (AccessibleObject.java:354)
    at java.lang.reflect.AccessibleObject.checkCanSetAccessible (AccessibleObject.java:297)
    at java.lang.reflect.Method.checkCanSetAccessible (Method.java:199)
    at java.lang.reflect.Method.setAccessible (Method.java:193)
    at net.sf.cglib.core.ReflectUtils$1.run (ReflectUtils.java:61)
    at java.security.AccessController.doPrivileged (AccessController.java:569)
    at net.sf.cglib.core.ReflectUtils.<clinit> (ReflectUtils.java:52)
    at net.sf.cglib.core.KeyFactory$Generator.generateClass (KeyFactory.java:243)
    at net.sf.cglib.core.DefaultGeneratorStrategy.generate (DefaultGeneratorStrategy.java:25)
    at net.sf.cglib.core.AbstractClassGenerator.generate (AbstractClassGenerator.java:329)
    at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply (AbstractClassGenerator.java:93)
    at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply (AbstractClassGenerator.java:91)
    at net.sf.cglib.core.internal.LoadingCache$2.call (LoadingCache.java:54)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at net.sf.cglib.core.internal.LoadingCache.createEntry (LoadingCache.java:61)
    at net.sf.cglib.core.internal.LoadingCache.get (LoadingCache.java:34)
    at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData.get (AbstractClassGenerator.java:116)
    at net.sf.cglib.core.AbstractClassGenerator.create (AbstractClassGenerator.java:291)
    at net.sf.cglib.core.KeyFactory$Generator.create (KeyFactory.java:221)
    at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:174)
    at net.sf.cglib.core.KeyFactory.create (KeyFactory.java:153)
    at net.sf.cglib.proxy.Enhancer.<clinit> (Enhancer.java:73)
    at com.sonar.sslr.api.typed.ActionParser.<init> (ActionParser.java:59)
    at org.sonar.json.parser.JSONParserBuilder.createParser (JSONParserBuilder.java:47)
    at org.sonar.json.parser.JSONParserBuilder.createParser (JSONParserBuilder.java:36)
    at org.sonar.plugins.json.JSONSquidSensor.<init> (JSONSquidSensor.java:85)
    at org.sonar.plugins.json.JSONSquidSensor.<init> (JSONSquidSensor.java:75)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstanceWithCaller (Constructor.java:499)
    at java.lang.reflect.Constructor.newInstance (Constructor.java:480)
    at org.picocontainer.injectors.AbstractInjector.newInstance (AbstractInjector.java:145)
    at org.picocontainer.injectors.ConstructorInjector$1.run (ConstructorInjector.java:342)
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe (AbstractInjector.java:270)
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance (ConstructorInjector.java:364)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance (AbstractInjectionFactory.java:56)
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance (AbstractBehavior.java:64)
    at org.picocontainer.behaviors.Stored.getComponentInstance (Stored.java:91)
    at org.picocontainer.DefaultPicoContainer.getLocalInstance (DefaultPicoContainer.java:606)
    at org.picocontainer.DefaultPicoContainer.getComponents (DefaultPicoContainer.java:587)
    at org.sonar.core.platform.ComponentContainer.getComponentsByType (ComponentContainer.java:291)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.completeScannerExtensions (AbstractExtensionDictionnary.java:82)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getExtensions (AbstractExtensionDictionnary.java:77)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getFilteredExtensions (AbstractExtensionDictionnary.java:67)
    at org.sonar.scanner.sensor.ModuleSensorExtensionDictionnary.selectSensors (ModuleSensorExtensionDictionnary.java:40)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$0 (ModuleSensorsExecutor.java:52)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:52)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:392)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:388)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:385)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:357)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:150)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:72)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:66)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at jdk.proxy7.$Proxy71.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
195964 [ERROR] 
195964 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
195964 [ERROR] 
195964 [ERROR] For more information about the errors and possible solutions, please read the following articles:
195964 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

The error seems to be related to Java 17, so I tried to set properties -Dsonar.java.source=17 -Dsonar.java.jdkHome=/usr/lib/jvm/java-17-amazon-corretto. But it doesn’t help…

Any idea?

Hi,

Welcome to the community!

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.9.9 → 9.9 → 10.1 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

Once you’ve upgraded to a current version, you’ll find that Java 17 is supported.

 
HTH,
Ann

After upgrading du SonarQube 9.9 on server side, everything is alright now.

1 Like