3

I am having a problem loading SonarLint 2.2.0 in my Eclipse Luna. The official web document says that 2.2.0 version is supported for Eclipse Luna. I also can install SonarLint from Eclipse Marketplace without any problem. But on eclipse restart, SonarLint cannot load. Diagnosing the plugin, I found that there are some missing bundles as shown in image below. enter image description here

While checking the bundle from OSGI console, I had the bundle and it was in ACTIVE status but of different version as shown below. enter image description here

Looking at this, I don't think I should downgrade equinox to version 0.0.0 if there's any. And not sure how can I deal with it. Any help would be appreciated guys.

Thanks

Mani Rai
  • 665
  • 2
  • 9
  • 22

3 Answers3

3

Version 2.2.0 of SonarLint for Eclipse moved to Java 8 (as well as the library SonarLint Core). As a consequence, the MANIFEST of all those bundle was updated to require JavaSE-1.8 execution environment.

If your Eclipse installation is not able to provide this requirement, the SonarLint plugin will not be loaded. I agree this silent failure is a shame, but if you have an idea on how to improve, let me know.

Possible reasons why your Eclipse doesn't provide JavaSE-1.8:

  • Eclipse was started with Java < 8. To be sure simply open Help -> About Eclipse -> Installation details -> Configuration and look for property java.version. Here the solution is simple: run Eclipse with a JVM 1.8+.
  • You are using a very old Eclipse version (< Kepler SR1). There is no Java 1.8 profile so it will not work even if you use a JVM 1.8 (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=387699). Luna is supposed to be supported, but if you upgraded from an older version of Eclipse if may be broken (see How do I add execution environment 1.8 to Eclipse Luna?). Try with a fresh installation of Luna or a more recent version.
Community
  • 1
  • 1
  • Thanks Julien... Java version was the real problem. Sorry for my foolishness of not reading docs properly. – Mani Rai Aug 25 '16 at 18:33
1

I'm seeing the same issue and ran diag in the OSGi console. I've found that the SonarLint eclipse bundles have references to 2.3.1 versions of the core SonarLint bundles, while the plug-in payload includes the 2.4.0 versions of the core packages.

For example: The diag command shows that the sonarlint.eclipse.core bundle is referencing sonarlint-client-api_2.3.1 while the plug-in payload includes sonarlint-client-api_2.4.0.

Note: I'm seeing the same version issue at the bottom of the diag window provided by the OP.

I'm thinking the SonarLint 2.2 bundle needs to be rebuilt/repackaged with the correct package versions.

Here's my OSGi console output for reference.

osgi> ss
...
1241    INSTALLED   org.sonarlint.eclipse.core_2.2.0.201607291419-RELEASE
1242    INSTALLED   org.sonarlint.eclipse.jdt_2.2.0.201607291419-RELEASE
1243    INSTALLED   org.sonarlint.eclipse.ui_2.2.0.201607291419-RELEASE
1244    INSTALLED   org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0
1245    INSTALLED   org.sonarsource.sonarlint.core.sonarlint-core_2.4.0


osgi> diag 1241
reference:file:plugins/org.sonarlint.eclipse.core_2.2.0.201607291419-RELEASE.jar [1241]
  Direct constraints which are unresolved:
    Missing required bundle org.sonarsource.sonarlint.core.sonarlint-client-api_2.3.1.
    Missing required bundle org.sonarsource.sonarlint.core.sonarlint-core_2.3.1.
    Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
  Leaf constraints in the dependency chain which are unresolved:
    reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-core_2.4.0.jar [1245]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
    reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".

osgi> diag 1242
reference:file:plugins/org.sonarlint.eclipse.jdt_2.2.0.201607291419-RELEASE.jar [1242]
  Direct constraints which are unresolved:
    Missing required bundle org.sonarlint.eclipse.core_0.0.0.
    Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
  Leaf constraints in the dependency chain which are unresolved:
    reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-core_2.4.0.jar [1245]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
    reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
    reference:file:plugins/org.sonarlint.eclipse.core_2.2.0.201607291419-RELEASE.jar [1241]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".

osgi> diag 1243
reference:file:plugins/org.sonarlint.eclipse.ui_2.2.0.201607291419-RELEASE.jar [1243]
  Direct constraints which are unresolved:
    Missing required bundle org.sonarlint.eclipse.core_0.0.0.
    Missing imported package org.sonarsource.sonarlint.core.client.api.connected_0.0.0.
    Missing imported package org.sonarsource.sonarlint.core.client.api.util_0.0.0.
    Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
  Leaf constraints in the dependency chain which are unresolved:
    reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-core_2.4.0.jar [1245]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
    reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
    reference:file:plugins/org.sonarlint.eclipse.core_2.2.0.201607291419-RELEASE.jar [1241]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".

osgi> diag 1244
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
  Direct constraints which are unresolved:
    Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".

osgi> diag 1245
reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-core_2.4.0.jar [1245]
  Direct constraints which are unresolved:
    Missing required bundle org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.
    Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
  Leaf constraints in the dependency chain which are unresolved:
    reference:file:plugins/org.sonarsource.sonarlint.core.sonarlint-client-api_2.4.0.jar [1244]
      Missing required capability Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))".
  • I am having same thought. Tried to report it as a bug, but cannot find the way. I think they have disable issue reporting feature in their github account. – Mani Rai Aug 05 '16 at 14:14
  • Guys, AFAIK in OSGi having a MANIFEST requesting version X.Y of a dependency means any version greater or equals to X.Y. Your real problem is the missing capability JavaSE-1.8. – Julien H. - SonarSource Team Aug 22 '16 at 13:55
0

Have you added the these plugins as a 'Required-Bundle' in your Manifest?

Nilesh Vora
  • 191
  • 1
  • 3
  • 14