{"record":{"id":"d464ee4b0da3e33a","repo":"SonarSource/sonarqube","slug":"the-plugin-s-does-not-support-java-s","errorCode":null,"errorMessage":"The plugin [%s] does not support Java %s","messagePattern":"The plugin \\[(.+?)\\] does not support Java (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"sonar-core/src/main/java/org/sonar/core/platform/PluginClassLoader.java","lineNumber":137,"sourceCode":"   *\n   * @return the instances grouped by plugin key\n   * @throws IllegalStateException if at least one plugin can't be correctly loaded\n   */\n  private static Map<String, Plugin> instantiatePluginClasses(Map<PluginClassLoaderDef, ClassLoader> classloaders) {\n    // instantiate plugins\n    Map<String, Plugin> instancesByPluginKey = new HashMap<>();\n    for (Map.Entry<PluginClassLoaderDef, ClassLoader> entry : classloaders.entrySet()) {\n      PluginClassLoaderDef def = entry.getKey();\n      ClassLoader classLoader = entry.getValue();\n\n      // the same classloader can be used by multiple plugins\n      for (Map.Entry<String, String> mainClassEntry : def.getMainClassesByPluginKey().entrySet()) {\n        String pluginKey = mainClassEntry.getKey();\n        String mainClass = mainClassEntry.getValue();\n        try {\n          instancesByPluginKey.put(pluginKey, (Plugin) classLoader.loadClass(mainClass).getDeclaredConstructor().newInstance());\n        } catch (UnsupportedClassVersionError e) {\n          throw new IllegalStateException(String.format(\"The plugin [%s] does not support Java %s\", pluginKey, SystemUtils.JAVA_VERSION), e);\n        } catch (Throwable e) {\n          throw new IllegalStateException(String.format(\"Fail to instantiate class [%s] of plugin [%s]\", mainClass, pluginKey), e);\n        }\n      }\n    }\n    return instancesByPluginKey;\n  }\n\n  public void unload(Collection<Plugin> plugins) {\n    for (Plugin plugin : plugins) {\n      ClassLoader classLoader = plugin.getClass().getClassLoader();\n      if (classLoader instanceof Closeable closeable && classLoader != classloaderFactory.baseClassLoader()) {\n        try {\n          closeable.close();\n        } catch (Exception e) {\n          LoggerFactory.getLogger(getClass()).error(\"Fail to close classloader \" + classLoader.toString(), e);\n        }\n      }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/sonar-core/src/main/java/org/sonar/core/platform/PluginClassLoader.java#L119-L155","documentation":"PluginClassLoader instantiates each plugin's main class; if the JVM raises UnsupportedClassVersionError (plugin compiled for a newer Java than the runtime), it is translated to an IllegalStateException stating the plugin does not support the current Java version.","triggerScenarios":"Loading a plugin whose main class was compiled with a class-file major version higher than the running JVM's JAVA_VERSION.","commonSituations":"Running SonarQube on an older JDK than plugins require (e.g. Java 8 runtime with Java 11-built plugins); plugins built without targeting older bytecode.","solutions":["Upgrade the JVM running SonarQube to the version the plugin requires","Downgrade the plugin to a build compatible with the current Java version","Rebuild the plugin targeting the appropriate --release byte-code level"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"int runtimeMajor = Integer.parseInt(System.getProperty(\"java.class.version\").split(\"\\\\.\")[0]) - 44;\n// compare against the plugin's required major version from its manifest before loading","typeGuard":null,"tryCatchPattern":"try {\n  return loader.load(pluginDef);\n} catch (IllegalStateException e) {\n  LOG.error(\"Plugin incompatible with current Java version\", e);\n  throw e;\n}","preventionTips":["Check plugin documentation for minimum Java version","Run SonarQube on the JVM version it was built for","Pin plugin versions tested against the platform's target JDK"],"tags":["java","plugins","compatibility"],"backgroundTag":"unsupported-platform","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}