简体   繁体   English

如何解决SonarLint eclipse缺少必需的包

[英]How to resolve missing required bundle for SonarLint eclipse

I am having a problem loading SonarLint 2.2.0 in my Eclipse Luna. 我在Eclipse Luna中加载SonarLint 2.2.0时遇到问题。 The official web document says that 2.2.0 version is supported for Eclipse Luna. 官方网站文档称Eclipse Luna支持2.2.0版本。 I also can install SonarLint from Eclipse Marketplace without any problem. 我也可以毫无问题地从Eclipse Marketplace安装SonarLint。 But on eclipse restart, SonarLint cannot load. 但是在eclipse重启时,SonarLint无法加载。 Diagnosing the plugin, I found that there are some missing bundles as shown in image below. 在诊断插件时,我发现有一些丢失的包,如下图所示。 在此输入图像描述

While checking the bundle from OSGI console, I had the bundle and it was in ACTIVE status but of different version as shown below. 从OSGI控制台检查捆绑包时,我有捆绑包,它处于ACTIVE状态,但版本不同,如下所示。 在此输入图像描述

Looking at this, I don't think I should downgrade equinox to version 0.0.0 if there's any. 看看这个,如果有的话,我认为我不应该将equinox降级到版本0.0.0。 And not sure how can I deal with it. 而且不确定我该如何处理它。 Any help would be appreciated guys. 任何帮助将不胜感激。

Thanks 谢谢

Version 2.2.0 of SonarLint for Eclipse moved to Java 8 (as well as the library SonarLint Core). SonarLint for Eclipse的2.2.0版本已移至Java 8(以及SonarLint Core库)。 As a consequence, the MANIFEST of all those bundle was updated to require JavaSE-1.8 execution environment. 因此,所有这些bundle的MANIFEST都被更新为需要JavaSE-1.8执行环境。

If your Eclipse installation is not able to provide this requirement, the SonarLint plugin will not be loaded. 如果您的Eclipse安装无法提供此要求,则不会加载SonarLint插件。 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不提供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 . Eclipse是用Java <8启动的。确保只需打开帮助 - >关于Eclipse - >安装细节 - >配置并查找属性java.version Here the solution is simple: run Eclipse with a JVM 1.8+. 这里的解决方案很简单:使用JVM 1.8+运行Eclipse。
  • You are using a very old Eclipse version (< Kepler SR1). 您使用的是非常旧的Eclipse版本(<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 ). 没有Java 1.8配置文件,因此即使您使用JVM 1.8也无法工作(请参阅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? ). Luna应该得到支持,但是如果你从旧版本的Eclipse升级则可能会被破坏(请参阅如何将执行环境1.8添加到Eclipse Luna? )。 Try with a fresh installation of Luna or a more recent version. 尝试全新安装Luna或更新版本。

I'm seeing the same issue and ran diag in the OSGi console. 我看到了同样的问题,并在OSGi控制台中运行了diag。 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. 我发现SonarLint eclipse捆绑包引用了2.3.1版本的核心SonarLint捆绑包,而插件有效负载包括2.4.0版本的核心包。

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. 例如:diag命令显示sonarlint.eclipse.core包引用sonarlint-client-api_2.3.1,而插件有效内容包括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. 注意:我在OP提供的diag窗口底部看到了相同的版本问题。

I'm thinking the SonarLint 2.2 bundle needs to be rebuilt/repackaged with the correct package versions. 我认为需要使用正确的软件包版本重建/重新打包SonarLint 2.2软件包。

Here's my OSGi console output for reference. 这是我的OSGi控制台输出供参考。

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))".

您是否已将这些插件添加为清单中的“必需捆绑包”?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM