java 装完jdk怎么启动_java – 安装JDK 9后无法启动Spring Tool Suite

安装SpringToolSuite后,升级至JDK9导致Eclipse无法启动,并出现java.lang.NoClassDefFoundError错误。此问题源于Java9的模块系统变化,通过在eclipse.ini中加入–add-modules=ALL-SYSTEM可解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参见英文答案 > Why won’t eclipse oxygen start (for the first time)?                                    3个

>            Neon: how to run on jdk9?                                    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)但是现在你可以使用一种解决方法:在eclipse.ini中添加–add-modules = ALL-SYSTEM到启动配置.有关完整示例,请参阅https://bugs.eclipse.org/bugs/show_bug.cgi?id=493761.

标签:java,spring,eclipse,java-9

来源: https://codeday.me/bug/20190727/1551026.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值