首页 > 解决方案 > Scala IDE在启动时抛出错误

问题描述

Scala IDE 启动时抛出错误。我试图找到解决此问题的方法,但无济于事。

我尝试过的解决方案。

在此处输入图像描述

尝试更改 java 安装的版本

我已经尝试了所有7、8、9、10 版本的 Java以及关闭 Mac。

我也升级了SBT版本-->没有成功。

试图删除 .metadata 目录--> 不成功

我正在使用的软件版本

sbt -> 1.1.6

Scala -> Scala 编译器版本 2.12.6

编辑:在日志文件上发布缩写内容

BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_IN
Framework arguments:  -keyring /Users/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -keyring /Users/utkarshrathor/.eclipse_keyring

!ENTRY org.eclipse.osgi 4 0 2018-07-18 10:12:52.810
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct

.
.
.

Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct

..

Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418

..
..

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-07-18 10:12:52.820
!MESSAGE FrameworkEvent ERROR
!STACK 0
java.lang.NoClassDefFoundError: javax/annotation/PreDestroy

..
..

Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418

..
..

org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct

..
..

Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct

..
..

Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418

..
.

java.lang.NoClassDefFoundError: javax/annotation/PreDestroy

..

Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418

标签: eclipsescalasbtscala-ide

解决方案


正如@greg-449 所建议的,我查看了“eclipse.app/Contents/Eclipse/eclipse.ini”文件并在-vmargs行下方添加了“--add-modules=ALL-SYSTEM”行。它启动了 scala IDE。

这个答案也帮助了我 https://stackoverflow.com/a/46370112/4390618


推荐阅读