Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve missing required bundle for SonarLint eclipse

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

like image 363
Mani Rai Avatar asked Sep 09 '26 15:09

Mani Rai


2 Answers

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.
like image 69
Julien H. - SonarSource Team Avatar answered Sep 13 '26 12:09

Julien H. - SonarSource Team


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))".
like image 31
Mike Middleton Avatar answered Sep 13 '26 14:09

Mike Middleton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!