SonarLint 3.6 in Eclipse 2018-09 with JDK 11

Hi,

I had used SonarLint 3.6 without any problems with Eclipse Oxygen and Photon. The IDE ran under JDK 8. I now run Eclipse 2018-09 with JDK 11 and SonarLint doesn’t seem to work in this configuration anymore, i.e. there are no blue squiggly lines in code editors anymore. If I start the same Eclipse installation with JDK 8 again, SonarLint annotations are visible again.

Is this a compatibility problem with JDK 11 or did I miss something?

I had the same problem. Sonarlint console shows 0 issues on both on-the-fly and project analysis.

Hi,

This is because the SonarJava analyzer embedded into SonarLint Eclipse 3.6 doesn’t support Java 11. This was fixed recently (https://jira.sonarsource.com/browse/SONARJAVA-2862). We will release a new version of SonarLint Eclipse with updated analyzers very soon.
https://jira.sonarsource.com/browse/SLE-258

1 Like

Hi Julien,

thanks for the info!

Any way i can get hold of a nightly with these changes until you release it ?

Any nightly update site which i can get the above fixes for java 11 running eclipse sonarlint ?

At least can you say if we build the latest code in the master branch if we could get support for Java 11 where the fixes from https://jira.sonarsource.com/browse/SLE-258 is present.

Hi @gayanper and @abhishek,

An RC or possible the official next release of SonarLint is coming very soon. Since you asked, here’s a nightly build you can try that is not guaranteed to be production ready:

This is built on this PR.

Cheers, and stay tuned for the final release!

Great thanks alot :slight_smile:

Hello @janos Thanks for the update. I installed the nightly build but it is still not working in my environment. @gayanper Is this working for you?

@abhishek Any stack trace to share (look at the SonarLint console and enable verbose logs) .

Are you using connected mode?

log.txt (262.9 KB)

@Julien_HENRY Nothing specific in the logs. I’ve attached the log file here. Same results both in connected mode as well as just analyzing offline.

The error is not supposed to be in Eclipse logs, but in the SonarLint console, with verbose checkbox enabled.

@Julien_HENRY Here you go. The logs are pointing to a generated bytecode version issue, I think…sonar_log.txt (756.0 KB)

My bad, I though the latest release of our Java analyzer was already able to analyze JDK 11 code. But in fact https://jira.sonarsource.com/browse/SONARJAVA-2862 will be part of the next release. I have created a ticket on SonarLint side to not forget:
https://jira.sonarsource.com/browse/SLE-289

We’ll do a new release as soon as SonarJava 5.8 is available.

The upcoming release of SonarLint will support JDK 10, but not JDK 11.

Sorry for the confusion.

Hello @Julien_HENRY Thanks for the update. Do you have an idea as to when the next release is or at least when we can get a nightly build?

EDIT as I’m not able to post more replies. @Julien_HENRY I’m not able to modify our SonarQube server. That’s my organization’s production server. Is there any way I can use this in standalone mode?

EDIT #2: Hello @Julien_HENRY Do you have a release date for SonarLint Eclipse 4.0? Or again, a nightly release that we can install?

Edit #3: Beautiful! That seems to be working. I haven’t tested it completely but I’m now seeing issues both on-the-fly as well as in the full report. Do you have a release date for the full release?

If you are using the connected mode, you can install a nightly build of SonarJava in your SonarQube server, then update SonarLint binding to get it.
Latest build from master is: https://repox.sonarsource.com/sonarsource/org/sonarsource/java/sonar-java-plugin/5.8.0.15630/sonar-java-plugin-5.8.0.15630.jar

Now the problem here i have is not being able to analyze java 11 source code, but to run the analysis of a java 8 source code while running eclipse with java 11. So do we really need to sonar-java plugin update for this ?
Can we also patch the given sonar-java plugin for none connected mode ?

To me it looks like an Eclipse bug. I have reported it here, let’s wait for feedback from Eclipse JDT developers.

OK, in fact this is not an issue of Eclipse, but due to: https://jira.sonarsource.com/browse/SONARJAVA-1222

Our Java analyzer will always try to resolve JDK symbols using the runtime JDK (here it means the JDK used to run Eclipse) while it should in perfect world use only classpath libraries.

But I have a good news, the final release of SonarJava 5.8 is planned for today, so it means we’ll be able to update it before releasing SonarLint Eclipse 4.0.

1 Like