gpt4 book ai didi

Scala IDE运行出现错误 "An error has occured. See the log file ...\.metaspace\.log."

转载 作者:行者123 更新时间:2023-12-02 17:51:45 26 4
gpt4 key购买 nike

Scala IDE Oxygen 2017 年 9 月运行时出现错误“发生错误。请参阅日志文件 ....metaspace.log。”

版本:Scala 代码运行器版本 2.12.3java版本“9.0.1”

日志:

    !SESSION 2018-01-04 16:05:39.934 -----------------------------------------------
eclipse.buildId=4.7.0-vfinal-2017-09-29T14:34:02Z-Typesafe
java.version=9.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=ru_RU
Command-line arguments: -os win32 -ws win32 -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2018-01-04 16:05:53.607
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:491)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:505)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:204)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:614)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
... 23 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct 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(Unknown Source)
... 25 more

我尝试将 PATH 设置为 JDK、JRE,无论如何都不起作用!SBT 已安装。

如何解决这个问题以及为什么会出现这种情况?

最佳答案

Scala IDE 需要 JDK 8,但尚不能与 JDK 9 配合使用:http://scala-ide.org/download/sdk.html (在“要求”部分中,它指出“JDK 8”)。

我可以推荐使用带有 Scala 插件的 IntelliJ - 即使社区版本也比任何基于 Eclipse 的 IDE 都要好得多,包括 Scala IDE:https://www.jetbrains.com/idea/download/

也就是说,Scala 中对 JDK 9+ 的完整支持的工作仍在进行中:https://github.com/scala/scala-dev/issues/139 。不过,这主要与构建 Scala 编译器本身有关;您很可能可以使用 JDK 11 毫无问题地编译 Scala 代码。

此处提供了包含 Java 版本兼容性最新状态的官方网页,其中包括相关 GitHub 问题的链接:https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html

关于Scala IDE运行出现错误 "An error has occured. See the log file ...\.metaspace\.log.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48175639/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com