Error in SonarLint for IntelliJ - NoClassDefFoundError


  • Java: JetBrains s.r.o. 11.0.12
  • OS: Mac OS X x86_64
  • IDE: IntelliJ IDEA 2021.2.3
  • SonarLint:
java.lang.NoClassDefFoundError: org/sonar/plugins/java/api/CheckRegistrar
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(
	at java.base/
	at java.base/
	at java.base/$
	at java.base/$
	at java.base/ Method)
	at java.base/
	at org.sonar.classloader.ClassRealm.loadClassFromSelf(
	at org.sonar.classloader.ParentFirstStrategy.loadClass(
	at org.sonar.classloader.ClassRealm.loadClass(
	at org.sonar.classloader.ClassRealm.loadClass(


It seems you have a custom plugin implementing some Java rules on your SonarQube server. This is normally supported, but here I guess you might have an outdated version of the Java analyzer, no more supported by SonarLint.
To verify that, could you please open in a web browser the page: https://<your sonarqube server>/api/plugins/installed and post the result here.


I have no server setup in SonarQube, and am unable to load the SonarLint settings in order to figure out where to look (above error)…

The stacktrace indicates the use of connected mode. Maybe you did try to setup connection to a SonarQube at some point?

Aren’t you able to open the SonarLint binding dialog to unbind your project?

If not, you can try to manually edit the project configuration:

  • close your project
  • edit the file .idea/sonarlint.xml
  • set bindingEnabled attribute to false
  • restart the project

I was able to disable bindings via editing sonarSettings.xml. That allowed me to bring up the SonarLint binding dialog when I started IntelliJ (toggling on/off updated that setting). The same exception occurs with bindings disabled. For reference, current sonarSettings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="projectSettings">
    <option name="alternativeWorkingDirPath" value="" />
    <option name="localAnalysisScripName" value="&lt;NO LOCAL ANALYSIS&gt;" />
    <option name="serverName" value="&lt;NO SONAR&gt;" />
    <option name="useAlternativeWorkingDir" value="false" />
    <option name="workingDirSelection" value="&lt;PROJECT&gt;" />
    <option name="bindingEnabled" value="false" /> <!-- added 10/28/21 -->

(comment disappeared when I toggled on/off in the dialog)


This file (sonarSettings.xml) and those settings (localAnalysisScripName, useAlternativeWorkingDir, …) are not part of the official SonarLint plugin. It seems they come from a plugin named “SonarQube Analyzer” that is not supported by SonarSource.
I suggest you remove this plugin, and ensure you are using an official SonarLint build.

The SonarLint settings file where the binding configuration is stored is named sonarlint.xml.

I removed both the SonarLint and SonarQube plugins, restarted IntelliJ, rm -rf .idea/sonar* (in my project), installed the SonarLint plugin, restarted IntelliJ…

Same NoClassDefFoundError for CheckRegistrar

As a followup, could this be the root cause? Before clicking on “Open SonarLint Settings” link, it has the following in the popup:

SonarLint failed to analyze TypeScript code
					SonarLint requires Node.js runtime version 10.12.0 or later to analyze TypeScript code.
					Please configure the Node.js path in the SonarLint settings.
					Open SonarLint Settings

If so, is there a way to add that in an xml? FWIW, no sonarlint.xml nor sonarSettings.xml since I did the clean install this morning…

When you have removed SonarLint and restarted your IDE, you don’t have the error anymore?

Correct - SonarLint is no longer there to give the error.

Then if you still see the exact same stacktrace as you reported in the first post, it means SonarLint is still in connected mode (using the cached data from a SonarQube server).
Try to open a brand new project since the binding settings are stored in project settings.