简体   繁体   English

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

[英]My eclipse crashed and now it won't start java.lang.NoClassDefFoundError: javax/annotation/PreDestroy

I was working on Java-oxygen eclipse version 4.7.3 and suddenly it froze then crashed.我正在研究 Java-oxygen eclipse 版本 4.7.3,突然它冻结然后崩溃。 When I tried to start it again I got an error window saying "an error has occured see the log file D:\\workspace.metadata.log."当我尝试再次启动它时,出现一个错误窗口,提示“发生错误,请参阅日志文件 D:\\workspace.metadata.log”。

when I checked that file I found this entry:当我检查该文件时,我发现了这个条目:

!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

Try below tips and see if it works尝试以下提示,看看它是否有效

  • Right click your project refresh右键单击您的项目刷新
  • It is usually caused by packaging tools error, you might want to add dependencies.通常是打包工具错误导致的,你可能需要添加依赖项。 This link might be helpful.链接可能会有所帮助。
  • If you are working on Maven project, right click on your project > Maven > Update project - This will updates necessary dependencies for your project如果您正在处理 Maven 项目,请右键单击您的项目 > Maven > 更新项目 - 这将为您的项目更新必要的依赖项
  • Try considering reinstalling Eclipse.尝试考虑重新安装 Eclipse。 If you are on Windows - Uninstall, restart your system and reinstall Eclipse IDE from here如果您使用的是 Windows - 卸载、重新启动系统并从此处重新安装 Eclipse IDE

暂无
暂无

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

相关问题 如何解决 java.lang.NoClassDefFoundError: javax/annotation/Generated? - How can be solved java.lang.NoClassDefFoundError: javax/annotation/Generated? 运行 java 类时,Tomcat 服务器不会在 Eclipse 中启动。 引起:java.lang.NoClassDefFoundError:org/json/JSONException - Tomcat server won't start in Eclipse when running java class. Caused by: java.lang.NoClassDefFoundError: org/json/JSONException Eclipse RCP java.lang.NoClassDefFoundError:javax / validation / ConstraintViolationException - Eclipse RCP java.lang.NoClassDefFoundError: javax/validation/ConstraintViolationException Eclipse: java.lang.NoClassDefFoundError: javax/activation/DataHandler - Eclipse: java.lang.NoClassDefFoundError: javax/activation/DataHandler Tomcat 7找不到我的类抛出javax.el.E​​LException:java.lang.NoClassDefFoundError - Tomcat 7 can't find my class throws javax.el.ELException: java.lang.NoClassDefFoundError Java不会在终端java.lang.NoClassDefFoundError中运行程序 - Java won't run program in terminal java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError:javax / validation / Validator - java.lang.NoClassDefFoundError: javax/validation/Validator java.lang.NoClassDefFoundError:javax / activation / DataContentHandler - java.lang.NoClassDefFoundError: javax/activation/DataContentHandler java.lang.NoClassDefFoundError:javax / ejb / EJBObject - java.lang.NoClassDefFoundError: javax/ejb/EJBObject java.lang.NoClassDefFoundError:javax / mail / MessagingException - java.lang.NoClassDefFoundError: javax/mail/MessagingException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM