java - 安装 JDK 9 后无法启动 Spring Tool Suite

标签 java spring eclipse java-9

<分区>

我已经安装了 Spring Tool Suite(版本 3.9.0)。它之前工作正常。安装 JDK 9 后,我无法启动 Spring Tool Suite。

虽然我可以在错误日志中看到以下内容:

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:844) 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:496)

问题真的是因为 JDK 9 吗?请为我指明解决问题的正确方向。

谢谢。

最佳答案

是的,这是由于 Java 9。Eclipse 中可能会有一个错误修复(请参阅 https://bugs.eclipse.org/bugs/show_bug.cgi?id=525583),但现在您可以使用解决方法:添加 --add-modules=ALL-SYSTEM 到 eclipse.ini 中的启动配置。有关完整示例,请参阅 https://bugs.eclipse.org/bugs/show_bug.cgi?id=493761 .

关于java - 安装 JDK 9 后无法启动 Spring Tool Suite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46599692/

相关文章:

java - 如何配置 Spring Data 以在没有 XML 的情况下将 Postgres 与 Hibernate 一起使用?

java - 在数组中搜索空元素

java - 是否可以在 Spring 中的两个 bean 的定义之外定义两个 bean 之间的依赖关系?

java - 服务层和 Controller : who takes care of what?

java - 如何受益于 Spring/JPA 来执行参数化查询而不引用实体

eclipse - 如何在 Eclipse 中运行的 Tomcat 上打开 HTTPS? (或者 Eclipse 在运行 Tomcat 时使用的 : How do I edit the server. xml 文件?)

java - tomcat8 和 eclipse 火星噩梦

java - 从多个并行线程中的表中删除时的 JPA 死锁

java - 不可能使用 Google Map API V2 开发简单的 Android 应用程序

java - 如何在子图之间共享 DomainAxis/RangeAxis 而不在每个图上绘制它们?