Problem with using/enable of SonarLint

231 views
Skip to first unread message

alice...@gmail.com

unread,
Nov 29, 2016, 10:30:54 AM11/29/16
to SonarLint
Hello,

I'm trying to install SonarLint in Eclipse. 
I'm using Eclipse Luna 4.4.1
I had JAVA 7 on my PC, but since I saw that JAVA 8 is required I installed also JAVA 8. 

The installation finished successfully and the Eclipse restarted. 
I expected now the code to be analysed but it isn't (tried variations which decently are not according to the rules). 

I searched for any way to enable the analysis but I don't see "Sonar" in any place in the Eclipse (apart from the installed plugins).   
Searched on project properties and etc.  

What should be done in this case to enable it and start using it?

Julien HENRY

unread,
Nov 29, 2016, 10:58:17 AM11/29/16
to alice...@gmail.com, SonarLint
Hi,

Installing a JDK 8 is not enough. You have to be sure your Eclipse is actually executed with this JDK 8. Please check Help -> About Eclipse -> Installation details -> Configuration

You should see something like:
java.runtime.version=1.8.0_111-b16

++

Julien

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/27957e77-b20d-43c9-9047-40a025f09609%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alice...@gmail.com

unread,
Nov 30, 2016, 11:27:14 AM11/30/16
to SonarLint, alice...@gmail.com
Hi Julien,

Thanks, I checked in the eclipse configuration file and saw that the version there was actually 1.7.

Now I installed older version of SonarLint - 2.0.2.
This version works for me with Java 7, but I cannot connect to our SonarQube server (we use SonarQube version 5.6.1).

I'm getting this: Unrecognized SSL message, plaintext connection? (when I try to connect with https)
or this (with http connection): Insufficient privileges

Alice


On Tuesday, November 29, 2016 at 5:58:17 PM UTC+2, Julien HENRY wrote:
Hi,

Installing a JDK 8 is not enough. You have to be sure your Eclipse is actually executed with this JDK 8. Please check Help -> About Eclipse -> Installation details -> Configuration

You should see something like:
java.runtime.version=1.8.0_111-b16

++

Julien
2016-11-29 16:30 GMT+01:00 <alice...@gmail.com>:
Hello,

I'm trying to install SonarLint in Eclipse. 
I'm using Eclipse Luna 4.4.1
I had JAVA 7 on my PC, but since I saw that JAVA 8 is required I installed also JAVA 8. 

The installation finished successfully and the Eclipse restarted. 
I expected now the code to be analysed but it isn't (tried variations which decently are not according to the rules). 

I searched for any way to enable the analysis but I don't see "Sonar" in any place in the Eclipse (apart from the installed plugins).   
Searched on project properties and etc.  

What should be done in this case to enable it and start using it?

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

Julien HENRY

unread,
Dec 1, 2016, 5:51:45 AM12/1/16
to Alice Cohen, SonarLint
(Adding the list back)

2016-12-01 11:40 GMT+01:00 Alice Cohen <alice...@gmail.com>:
I installed 2.1.0 version - and I'm able to connect to SonarQube server with it.

Cool. Even with a "non admin" user?
 
But, when binding project to SonarQube project, it stops showing the issues (sometimes shows 1 or 2 issues but we see in SonarQube that we have much more).
This usually means you are using non SonarSource analyzers (PMD/Findbugs/Checkstyle). SonarLint only supports SonarSource analyzers (rules from the "squid" repository for Java). Please check your quality profile content.

++

Julien



Alice Cohen

unread,
Dec 1, 2016, 7:22:28 AM12/1/16
to Julien HENRY, SonarLint
Yes, in version 2.1.0 i connected to the server without Admin.

The rules that we use are from SonarSource type.

For example, in the class that I have in eclipse, I see in SonarQube the following issues:
- Magic numbers should not be used (squid:S109)
-
Methods should not have too many lines (squid:S138)
and etc.

None of this are presented in SonarLint.
The only rule that I saw by now in SonarLint is:
- Sections of code should not be "commented out" (squid:CommentedOutCodeLine)

Julien HENRY

unread,
Dec 1, 2016, 8:18:24 AM12/1/16
to Alice Cohen, SonarLint
Can you double check that the Eclipse project is bound to the correct SonarQube project. And then check that the SonarQube project is associated to a quality profile where those rules are activated?

Alice Cohen

unread,
Dec 1, 2016, 10:17:17 AM12/1/16
to Julien HENRY, SonarLint
I rechecked - and bounded the projects again.
Also rechecked the rules.

We have total 4 projects.
For one project it started to work immediately.
For the second one, it started working only when I bounded it again (to the exact same project as was before).

But it works only for 2/4 of our projects, although I did exactly the same steps.
(We use 2 different profiles for the 4 projects, each project uses 1 profile, and both of the profiles use only SonarQube rules).
Reply all
Reply to author
Forward
0 new messages