You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Eclipse 2022-12中SpotBugs 4.7.3运行异常求助

问题描述

在Eclipse Version: 2022-12 (4.26.0)中安装SpotBugs 4.7.3.r202210170504-fa9e53a插件,项目使用Java SE 8,运行SpotBugs时抛出如下异常:

java.io.IOException: Unable to resolve plug-in "edu.umd.cs.findbugs.plugin.eclipse".
at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.parse(PlatformURLPluginConnection.java:64)
at org.eclipse.core.internal.runtime.FindSupport.find(FindSupport.java:295)
at org.eclipse.core.runtime.FileLocator.find(FileLocator.java:211)
at org.eclipse.jface.resource.URLImageDescriptor.getStream(URLImageDescriptor.java:139)
at org.eclipse.jface.resource.URLImageDescriptor.getImageData(URLImageDescriptor.java:107)
at org.eclipse.jface.resource.URLImageDescriptor.getImageData(URLImageDescriptor.java:85)
at org.eclipse.swt.graphics.Image.<init>(Image.java:827)
at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:249)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:290)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:268)
at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack.getImage(TrimStack.java:816)
at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack.updateTrimStackItems(TrimStack.java:881)
at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack.createWidget(TrimStack.java:636)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:344)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:227)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:94)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37)

已确认使用最新版本插件,仍出现该错误。

解决方法
  • 检查Eclipse运行JRE版本:Eclipse 2022-12(4.26.0)要求运行环境为Java 11或更高版本,即使项目编译用Java 8,Eclipse自身必须用Java 11+启动。如果当前Eclipse用Java 8运行,会导致插件加载异常,需修改eclipse.ini文件中的-vm参数指向Java 11+的JDK路径。
  • 彻底重装SpotBugs插件:
    1. 打开Eclipse,依次点击Help > About Eclipse IDE > Installation Details
    2. 在Installed Software标签下找到所有SpotBugs相关组件,点击Uninstall完成卸载后重启Eclipse
    3. 从Eclipse Marketplace或SpotBugs官方更新站点重新安装适配Eclipse 2022-12的版本,安装过程确保勾选所有依赖组件
  • 手动补充依赖插件:错误中提到的edu.umd.cs.findbugs.plugin.eclipse是旧FindBugs的核心插件,可添加FindBugs更新站点安装基础版FindBugs插件,再重新安装SpotBugs
  • 清理Eclipse缓存:关闭Eclipse后,删除工作目录下的/.metadata/.plugins/org.eclipse.core.resources/.history和/.metadata/.plugins/org.eclipse.e4.workbench文件夹,重启Eclipse后再测试SpotBugs功能

内容的提问来源于stack exchange,提问作者im_who_code

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 22:47:47