使用 Eclipse IDE 为 Java EE 开发人员安装 FindBugs 插件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13744530/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:34:04  来源:igfitidea点击:

Installation of FindBugs plugin with Eclipse IDE for Java EE Developers

eclipsepluginsinstallfindbugs

提问by Aidan Whitehall

I'm struggling to get the Eclipse FindBugs plugin to work and am sure there's a schoolboy error being made somewhere.

我正在努力使 Eclipse FindBugs 插件正常工作,并且我确定某处出现了小学生错误。

I extracted the file findbugs-2.0.2-rc2.zipto a local folder C:\Program Files\findbugs-2.0.2-rc2and running findbugs.bat, FindBugs works fine running it over a local Java (Eclipse) project.

我将文件findbugs-2.0.2-rc2.zip 解压缩 到本地文件夹C:\Program Files\findbugs-2.0.2-rc2并运行findbugs.bat,FindBugs 可以在本地 Java (Eclipse) 项目上正常运行它。

I added the FindBugs update site, it found "FindBugs Feature, 2.0.1.20120712" and installed it. Restarting, right-clicking on an open Java Project doesn't display the "FindBugs" option (that this videoshows).

我添加了FindBugs 更新站点,它找到了“FindBugs Feature,2.0.1.20120712”并安装了它。重新启动,右键单击打开的 Java 项目不会显示“FindBugs”选项(此视频显示)。

I looked in Window > Preferencesto try to find a way to inform the plugin of the local FindBugs installation (in Program Files), but couldn't find anything.

我查看了Window > Preferences试图找到一种方法来通知插件本地 FindBugs 安装(在程序文件中),但找不到任何东西。

Uninstalling "FindBug Feature", I tried extracting the FindBugs Eclipse plugin zip fileinto Eclipse's plugins folder, but after a restart, saw no difference.

卸载“FindBug Feature”后,我尝试将 FindBugs Eclipse 插件zip 文件解压缩到 Eclipse 的插件文件夹中,但重新启动后,发现没有任何区别。

Help > About Eclipse > Installation Details > Installed Softwarelists "FindBugs Feature 2.0.1.20120712".

帮助 > 关于 Eclipse > 安装详细信息 > 已安装的软件列出了“FindBugs Feature 2.0.1.20120712”。

Can anyone please offer a pointer on where I'm going wrong here? Thanks!

任何人都可以请指出我在这里出错的地方吗?谢谢!

Windows 7, Eclipse IDE for Java EE Developers Juno SR1, JDK 1.7.0_09, FindBugs 2.0.2-rc2

Windows 7、面向 Java EE 开发人员的 Eclipse IDE Juno SR1、JDK 1.7.0_09、FindBugs 2.0.2-rc2

回答by JohnK

As suggested above, problem is likely caused by not having appropriate write access to the C:\Program Files\Eclipse\plugins folder.

如上所述,问题很可能是由于对 C:\Program Files\Eclipse\plugins 文件夹没有适当的写访问权限造成的。

Solution: Close Eclipse. Restart Eclipse as Administrator (right click - Run as Administrator). Reinstall plugin. Restart Eclipse.

解决方案:关闭Eclipse。以管理员身份重新启动 Eclipse(右键单击 - 以管理员身份运行)。重新安装插件。重新启动 Eclipse。

回答by THelper

It looks like the Findbugs plugin wasn't installed properly and/or disabled by Eclipse. There can be several causes.

Findbugs 插件似乎没有正确安装和/或被 Eclipse 禁用。可能有多种原因。

  1. Multiple versions of the same plugin. To make sure this isn't the case, remove all Findbugs versions (installed manually and via the marketplace), and reinstall one (preferably via the marketplace). Watch for any warnings during installation.
  2. There is a (dependency) conflict with another plugin. However, if this is the case I think Eclipse will warn in the log which other plugin is the cause of the conflict.
  3. Rights problem. Make sure you have write permissions in the main Eclipse folder and all it's child folders.
  4. I remember reading somewhere that installing Eclipse under the C:\Program Files\in Windows can also be causing problems. Try moving Eclipse to a different folder, e.g. C:\Eclipse
  1. 同一插件的多个版本。为确保不是这种情况,请删除所有 Findbugs 版本(手动安装和通过市场安装),然后重新安装一个(最好通过市场)。在安装过程中注意任何警告。
  2. 与另一个插件存在(依赖)冲突。但是,如果是这种情况,我认为 Eclipse 会在日志中警告哪个其他插件是导致冲突的原因。
  3. 权利问题。确保您在主 Eclipse 文件夹及其所有子文件夹中具有写入权限。
  4. 我记得在某个地方读到过C:\Program Files\在 Windows下安装 Eclipse也会导致问题。尝试将 Eclipse 移动到不同的文件夹,例如C:\Eclipse

回答by Sandeep Nautiyal

Hi I also faced the similar problem but from my own experience i can suggest you the solution :-

嗨,我也遇到了类似的问题,但根据我自己的经验,我可以向您建议解决方案:-

Plz ensure that you are using eclipse version 3.6 or higher. findbugs 2.0 is not compatible with Eclipse 3.5(Eclipse Galileo).

请确保您使用的是 Eclipse 3.6 或更高版本。findbugs 2.0 与 Eclipse 3.5(Eclipse Galileo) 不兼容。

1) Plz extract the findbugs zip file into eclipse folder(wher your eclipse is installed). This will automatically move findbug plugins into eclipse plugins folder. Restart the eclipse and you will find findbugs option on right clicking on project.

1)请将 findbugs zip 文件解压缩到 eclipse 文件夹中(安装 eclipse 时)。这将自动将 findbug 插件移动到 eclipse 插件文件夹中。重新启动 Eclipse,您将在项目上右键单击找到 findbugs 选项。

2) if 1 step does not work plz remove all the findbug jars for the eclipse plugins folder and place the complete folder into the eclipse dropins folder. Restart the eclipse and you will see the difference.

2) 如果 1 步不起作用,请删除 eclipse plugins 文件夹的所有 findbug jar,并将完整文件夹放入 eclipse dropins 文件夹中。重新启动日食,您将看到不同之处。

回答by Ravi Kant

You can follow these step's to make findbugs work in your eclipse.

您可以按照这些步骤使 findbugs 在您的 eclipse 中工作。

1.Install FireBug plugin from marketplace.

1.从市场安装FireBug插件。

Help->Eclipse Marketplace ->then search for FindBugs

2.Configure FindBug for your project

2.为你的项目配置 FindBug

using MavenWithout Maven

没有 Maven 的情况下使用Maven

This worked fine for me using eclipse juno.

这对我使用 eclipse juno 很好。