简体   繁体   English

在 Eclipse 上安装 PMD 时出错 版本:2020-06 (4.16.0)

[英]Error installing PMD on Eclipse Version: 2020-06 (4.16.0)

I recently upgraded to Eclipse Version: 2020-06 ( 4.16.0 ) on Windows 10.我最近在 Windows 10 上升级到 Eclipse 版本:2020-06 ( 4.16.0 )。

My java version is "14.0.1" 2020-04-14我的 java 版本是“14.0.1” 2020-04-14

After the upgrade, I attempted to install Eclipse-PMD 2.0 from the Marketplace ( help / Eclipse Marketplace / etc. )...I receive the error(s):升级后,我尝试从 Marketplace 安装Eclipse-PMD 2.0帮助 / Eclipse Marketplace / 等)...我收到错误:

Cannot complete the install because some dependencies are not satisfiable Software being installed: a.jre.javase 14.0.0 Software being installed: Eclipse PMD Plug-in 2.0.0.202006052026 (ch.acanda.eclipse.pmd.feature.feature.group 2.0.0.202006052026)无法完成安装,因为某些依赖项无法满足 正在安装的软件:a.jre.javase 14.0.0 正在安装的软件:Eclipse PMD Plug-in 2.0.0.202006052026 (ch.acanda.Z6B7B655DD22FAA3F1060.0.ZC512493A 8) 0.202006052026)
Cannot satisfy dependency: From: Eclipse PMD Plug-in 2.0.0.202006052026 (ch.acanda.eclipse.pmd.feature.feature.group 2.0.0.202006052026) To: org.eclipse.equinox.p2.iu; Cannot satisfy dependency: From: Eclipse PMD Plug-in 2.0.0.202006052026 (ch.acanda.eclipse.pmd.feature.feature.group 2.0.0.202006052026) To: org.eclipse.equinox.p2.iu; ch.acanda.eclipse.pmd.java.feature.feature.group [2.0.0.202006052026,2.0.0.202006052026] Cannot satisfy dependency: From: eclipse-pmd Java 2.0.0.202006052026 (ch.acanda.eclipse.pmd.java 2.0.0.202006052026) To: osgi.ee; ch.acanda.eclipse.pmd.java.feature.feature.group [2.0.0.202006052026,2.0.0.202006052026] Cannot satisfy dependency: From: eclipse-pmd Java 2.0.0.202006052026 (ch.acanda.eclipse.pmd.java 2.0.0.202006052026 ) 至:osgi.ee; (&(osgi.ee=JavaSE)(version=11)) Cannot satisfy dependency: From: eclipse-pmd Java Support (Optional, JDT Prerequisite) 2.0.0.202006052026 (ch.acanda.eclipse.pmd.java.feature.feature.group 2.0.0.202006052026) To: org.eclipse.equinox.p2.iu; (&(osgi.ee=JavaSE)(version=11)) Cannot satisfy dependency: From: eclipse-pmd Java Support (Optional, JDT Prerequisite) 2.0.0.202006052026 (ch.acanda.eclipse.pmd.java.feature.feature.组 2.0.0.202006052026) 至:org.eclipse.equinox.p2.iu; ch.acanda.eclipse.pmd.java [2.0.0.202006052026,2.0.0.202006052026] ch.acanda.eclipse.pmd.java [2.0.0.202006052026,2.0.0.202006052026]

Does anyone have an idea(s) as regards the source of the issue...if all else fails I may try building the PMD source from the github repo ( https://github.com/eclipse-pmd/eclipse-pmd ) but I cannot imagine why this should be necessary.有没有人对问题的根源有任何想法......如果一切都失败了,我可以尝试从 github 回购( https://github.com/eclipse-pmd/eclipse-pmd )构建 PMD 源但我无法想象为什么这应该是必要的。

I created eclipse-pmd and I can install eclipse-pmd 2.0 from the marketplace with Java 14 and Eclipse 2020-06 without any problems.我创建了 eclipse-pmd,我可以从市场上安装 eclipse-pmd 2.0,使用 Java 14 和 Eclipse 2020-06 没有任何问题。

From the error message you provided it looks like there are two missing dependencies:从您提供的错误消息看来,缺少两个依赖项:

  1. ch.acanda.eclipse.pmd.java requires (&(osgi.ee=JavaSE)(version=11)) ch.acanda.eclipse.pmd.java 需要 (&(osgi.ee=JavaSE)(version=11))
  2. several plugins require org.eclipse.equinox.p2.iu and ch.acanda.eclipse.pmd.java几个插件需要 org.eclipse.equinox.p2.iu 和 ch.acanda.eclipse.pmd.java

The first issue indicates that you do not run Eclipse with Java 11+.第一个问题表明您没有运行 Eclipse 和 Java 11+。 Check the Java version by opening the "Installation Details" dialog: Help > About Eclipse IDE > Installation Details > Configuration .通过打开“安装详细信息”对话框检查 Java 版本: Help > About Eclipse IDE > Installation Details > Configuration Then look for the system property java.version .然后查找系统属性java.version If it shows a version lower than 11, then you need to configure Eclipse to run with Java 11+ .如果显示版本低于 11,则需要配置 Eclipse 以与 Java 11+ 一起运行

The second issue looks like a subsequent error.第二个问题看起来像是一个后续错误。 Since ch.acanda.eclipse.pmd.java couldn't be installed, all plugins that depend on this plugin cannot be installed either.由于 ch.acanda.eclipse.pmd.java 无法安装,因此所有依赖此插件的插件也无法安装。 Why org.eclipse.equinox.p2.iu is also mentioned in the error message is unclear to me since eclipse-pmd does not (directly) depend on this plugin and it should be a plugin installed by default in Eclipse.为什么错误消息中还提到了 org.eclipse.equinox.p2.iu 我不清楚,因为 eclipse-pmd 不(直接)依赖于这个插件,它应该是默认安装在 Eclipse 中的插件。

If this does not fix your problem, then please open a new issue on Github as it is easier to help with problems like this on Github than on Stack Overflow.如果这不能解决您的问题,请在 Github 上打开一个新问题,因为在 Github 上解决此类问题比在 Stack Overflow 上更容易。

You need to run Eclipse with a Java 11 JRE.您需要使用 Java 11 JRE 运行 Eclipse。 This is normally done by insuring you have JAVA_HOME set to Java 11, and JAVA_HOME in your path.这通常通过确保将 JAVA_HOME 设置为 Java 11 和路径中的 JAVA_HOME 来完成。 Alternatively, you can modify eclipse.ini and specify Java 11 as the vm ( How to run Eclipse with different Java version? ). Alternatively, you can modify eclipse.ini and specify Java 11 as the vm ( How to run Eclipse with different Java version? ).

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

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