SonarLint not able to scan Java files

Using SonarQube 7.9.1 LTS
SonarLint for Eclipse 4.1.0.201901311043
Java Code Quality and Security - 6.3.2 (build 22818)

Trying to run SonarLint analysis on a Java file but no results. Log shows that Java sensor is not being detected.

Is SonarLint version not compatible with Java sensor version? If not, how to downgrade Java sensor to last compatible version with SonarLint 4.1.0 ?

Analysis log:

Trigger: MANUAL
Clear markers on 0 excluded files
SonarLint processing file /<filename>.java...
Connected mode (using configuration of 'xx' in server 'url')
Available languages:
  * C => "c"
  * C++ => "cpp"
  * Objective-C => "objc"
  * COBOL => "cobol"
  * HTML => "web"
  * JSP => "jsp"
  * XML => "xml"
  * RPG => "rpg"
  * PL/I => "pli"
  * T-SQL => "tsql"
  * ABAP => "abap"
  * Apex => "apex"
  * PL/SQL => "plsql"
Start analysis
Declared extensions of language C were converted to c: **/*.disabled
Declared extensions of language C++ were converted to cpp: **/*.disabled
Declared extensions of language Objective-C were converted to objc: **/*.disabled
Declared extensions of language COBOL were converted to cobol: 
Declared extensions of language HTML were converted to web: **/*.html,**/*.xhtml,**/*.rhtml,**/*.shtml
Declared extensions of language JSP were converted to jsp: **/*.jsp,**/*.jspf,**/*.jspx
Declared extensions of language XML were converted to xml: **/*.xml,**/*.xsd,**/*.xsl
Declared extensions of language RPG were converted to rpg: **/*.rpg,**/*.rpgle,**/*.rpg,**/*.rpgle
Declared extensions of language PL/I were converted to pli: **/*.pli
Declared extensions of language T-SQL were converted to tsql: **/*.tsql
Declared extensions of language ABAP were converted to abap: **/*.abap,**/*.ab4,**/*.flow,**/*.asprog
Declared extensions of language Apex were converted to apex: **/*.cls,**/*.trigger
Declared extensions of language PL/SQL were converted to plsql: **/*.sql,**/*.pks,**/*.pkb
Index files
1 files indexed
Quality profiles:
  * abap: 'Sonar way' (65 rules)
  * apex: 'Sonar way' (29 rules)
  * c: 'Sonar way' (155 rules)
  * cobol: 'Sonar way' (75 rules)
  * cpp: 'Sonar way' (246 rules)
  * jsp: 'Sonar way' (0 rules)
  * objc: 'Sonar way' (149 rules)
  * pli: 'Sonar way' (14 rules)
  * plsql: 'Sonar way' (130 rules)
  * rpg: 'Sonar way' (31 rules)
  * tsql: 'Sonar way' (54 rules)
  * web: 'xx-xx-Web-xx-Profile' (12 rules)
  * xml: 'xx-xx-XML-xx-Profile' (3 rules)
Setting filesystem encoding: UTF-8
'CobolSquidSensor' skipped because there is no related file in current project
'CFamily' skipped because there is no related file in current project
Execute Sensor: HTML
'XML Sensor' skipped because there is no related file in current project
'RPG sensor' skipped because there is no related file in current project
'PliSquidSensor' skipped because there is no related file in current project
'T-SQL Sensor' skipped because there is no related file in current project
'AbapSquidSensor' skipped because there is no related file in current project
'Apex Sensor' skipped because there is no related file in current project
'PL/SQL Sensor' skipped because there is no related file in current project
Found 0 issue(s)
Done in 3047 ms

Hello, thank you for your question.

In Eclipse, SonarLint will enable the Java analyzer only if it can find JDT, the standard Eclipse support for Java, which might not be installed on the Eclipse flavor you use.

Which IDE are you using? Could you please clean your SonarLint console, trigger an update of the project binding, and post the generated log? This should allow us to confirm this hypothesis.

Using Rational Application Developer which is Eclipse based. No problem with JDT I believe, it was working fine till sometime back.

Here is the generated log, and it clearly shows the problem.
Where can I see the max SonarJava version compatible with SonarLint 4.1.0 ?

Create : C:\Users\username\.sonarlint\plugins
Plugin cache: C:\Users\username\.sonarlint\plugins
Create : C:\Users\username\.sonarlint\plugins\_tmp
GET 200 https://squrl/api/system/status | response time=31ms
Downloaded server infos in 31ms
GET 200 https://squrl/api/plugins/installed | response time=219ms
Downloaded plugin list in 219ms
GET 200 https://squrl/api/settings/values.protobuf | response time=234ms
Downloaded settings in 234ms
Code analyzer 'dependencycheck' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'scmgit' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'ldap' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'csharp' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'cssfamily' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'swift' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'vbnet' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'vb' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'security' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'securitycsharpfrontend' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'securityjavafrontend' is not compatible with SonarLint. Skip downloading it.
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=INFO&p=1&ps=500 | response time=203ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MINOR&p=1&ps=500 | response time=312ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MINOR&p=2&ps=500 | response time=453ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MAJOR&p=1&ps=500 | response time=343ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MAJOR&p=2&ps=500 | response time=297ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MAJOR&p=3&ps=500 | response time=266ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MAJOR&p=4&ps=500 | response time=218ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=CRITICAL&p=1&ps=500 | response time=406ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=CRITICAL&p=2&ps=500 | response time=219ms
GET 200 https://squrl/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=BLOCKER&p=1&ps=500 | response time=312ms
GET 200 https://squrl/api/qualityprofiles/search.protobuf | response time=305ms
Downloaded quality profiles in 305ms
GET 200 https://squrl/api/components/search.protobuf?qualifiers=TRK&ps=500&p=1 | response time=218ms
Page downloaded in 218ms
Create : C:\Users\username\.sonarlint\plugins
Plugin cache: C:\Users\username\.sonarlint\plugins
Create : C:\Users\username\.sonarlint\plugins\_tmp
Load plugins
**Code analyzer 'Java Code Quality and Security' needs SonarQube plugin API 7.9 while SonarLint supports only up to 7.6. Skip loading it.**
Code analyzer 'SonarJS' needs SonarQube plugin API 7.9 while SonarLint supports only up to 7.6. Skip loading it.
Code analyzer 'SonarTS' needs SonarQube plugin API 7.9 while SonarLint supports only up to 7.6. Skip loading it.
Load plugins (done) | time=93ms
Plugins:
  * License for SonarLint 7.9.1 (license)
  * SonarCFamily 6.3.0.11371 (cpp)
  * SonarCOBOL 4.4.0.3403 (cobol)
  * SonarHTML 3.1.0.1615 (web)
  * SonarXML 2.0.1.2020 (xml)
  * SonarRPG 2.3.0.1187 (rpg)
  * SonarPLI 1.10.0.1880 (pli)
  * SonarTSQL 1.4.0.3334 (tsql)
  * SonarABAP 3.8.0.2034 (abap)
  * SonarApex 1.5.0.315 (sonarapex)
  * SonarPLSQL 3.4.1.2576 (plsql)
Using storage for server 'squrl' (last update 9/25/20 8:27 AM)
GET 200 https://squrl/api/qualityprofiles/search.protobuf?project=projectname | response time=235ms
Downloaded project quality profiles in 235ms
GET 200 https://squrl/api/settings/values.protobuf?component=projectname | response time=203ms
Downloaded settings in 203ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=BRC&component=projectname&ps=500&p=1 | response time=203ms
Page downloaded in 203ms
GET 200 https://squrl/batch/issues?key=projectname | response time=1634ms
Downloaded issues in 2321ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=FIL,UTS&component=projectname&ps=500&p=1 | response time=329ms
Page downloaded in 344ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=FIL,UTS&component=projectname&ps=500&p=2 | response time=328ms
Page downloaded in 344ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=FIL,UTS&component=projectname&ps=500&p=3 | response time=344ms
Page downloaded in 359ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=FIL,UTS&component=projectname&ps=500&p=4 | response time=337ms
Page downloaded in 353ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=FIL,UTS&component=projectname&ps=500&p=5 | response time=315ms
Page downloaded in 315ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=FIL,UTS&component=projectname&ps=500&p=6 | response time=320ms
Page downloaded in 336ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=FIL,UTS&component=projectname&ps=500&p=7 | response time=281ms
Page downloaded in 297ms
GET 200 https://squrl/api/components/tree.protobuf?qualifiers=FIL,UTS&component=projectname&ps=500&p=8 | response time=281ms
Page downloaded in 281ms

Hello,

May I ask why you don’t consider updating SonarLint? Version 4.1.0 is quite old now. If you want to benefit from all the newest rules of the Java analyzer, you should better try to use recent versions.

I do want to upgrade SonarLint eventually but I need to find the max version that is compatible with Eclipse Platform 4.7.3.v20180301-0715 (Oxygen) because that is what RAD is based on. Without knowing this, upgrade of SonarLint to just the recent version may not work as it might look for dependencies which may not be available with Eclipse Platform 4.7.3.

Is there a matrix available for version compatibility between SonarLint/Eclipse/SonarJava version ?

We don’t maintain a compatibility matrix of the past releases, since this is too hard to keep up to date.

On the Eclipse marketplace, you can see all versions of Eclipse we support, for the latest version of SonarLint.
Today we support Eclipse 4.4 (Luna) and later.

Then regarding connected mode, our strategy is to follow the SonarQube LTS lifecycle. If you are on a SonarQube LTS (7.9) the you should be fine. For analyzers it means we support the ones that were bundled with SonarQube 7.9, or more recent if you have upgraded them.
But in fact we are generally supporting much older versions versions. No promise on how long it will last, but as of today, the minimal version of the Java analyzer SonarLint can work with is 5.1.

Hope that helped.

Thanks, this was helpful. I was able to update SonarLint 4.1.0 to 5.3.0 on Eclipse 4.7 without any dependencies issues.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.