java - 我的 Eclipse 崩溃了,现在它无法启动 java.lang.NoClassDefFoundError : javax/annotation/PreDestroy

标签 java eclipse startup

我正在开发 Java-oxygen eclipse 版本 4.7.3,突然它卡住然后崩溃了。当我尝试再次启动它时,出现一个错误窗口,显示“发生错误,请参阅日志文件 D:\workspace.metadata.log。”

当我检查该文件时,我发现了这个条目:

!MESSAGE FrameworkEvent ERROR
!STACK 0
java.lang.NoClassDefFoundError: javax/annotation/PreDestroy
    at org.eclipse.e4.core.internal.di.InjectorImpl.disposed(InjectorImpl.java:450)
    at org.eclipse.e4.core.internal.di.Requestor.disposed(Requestor.java:156)
    at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:78)
    at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:111)
    at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.handleInvalid(TrackableComputationExt.java:74)
    at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:178)
    at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.dispose(EclipseContextOSGi.java:99)
    at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.bundleChanged(EclipseContextOSGi.java:141)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
    at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
    at org.eclipse.osgi.container.Module.doStop(Module.java:634)
    at org.eclipse.osgi.container.Module.stop(Module.java:498)
    at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 21 more```

I tried changing the workspace in the eclipse settings file "org.eclipse.ui.ide.prefs" but it just wrote the same error in the log file of the new workspace.

I guess this error has something with eclipse not shutting down correctly but I don't know how to fix it

最佳答案

尝试以下提示,看看是否有效

  • 右键单击您的项目刷新
  • 这通常是由于打包工具错误引起的,您可能需要添加依赖项。这个link可能会有所帮助。
  • 如果您正在处理 Maven 项目,请右键单击您的项目 > Maven > 更新项目 - 这将更新您项目的必要依赖项
  • 尝试考虑重新安装 Eclipse。如果您使用的是 Windows - 卸载,重新启动系统并从 here 重新安装 Eclipse IDE

关于java - 我的 Eclipse 崩溃了,现在它无法启动 java.lang.NoClassDefFoundError : javax/annotation/PreDestroy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60604498/

相关文章:

java - Play Framework 形式问题

java - 两个类之间的属性依赖

java.sql.SQLException : Numeric Overflow while using IN operator

java - AVD 模拟器未在 Eclipse 中启动

c# - 如何在 Window 启动 C# 时将 wpf 应用程序移动到最小化托盘?

google-chrome - 禁用 Chrome 中的启动设置

java - 是否可以通过我的 Eclipse 项目一次在表中插入多个列的值?

java - 如何配置 m2e eclipse 插件以支持父版本范围?

eclipse - 从 NetBeans 迁移到 Eclipse

java - 无法启动 Tomcat 服务器。使用 Java 1.7 编译。使用 JSF 2.0。给出 UnsupportedClassVersionError : com/sun/faces/config/FacesInitializer