Scala 与 ScalaFx:依赖项无效或缺失
Scala with ScalaFx: invalid or missing dependency
我从 SDK 版本 scala-SDK-4.4.1-vfinal-2.11-win32.win32.x86_64
切换到版本 scala-SDK-4.5.0-vfinal-2.11-win32.win32.x86_64
后,我在 eclipse 中收到一些错误消息:
完整的错误信息:
missing or invalid dependency
detected while loading class file 'Alert.class'. Could not access term
Alert in package javafx.scene.control, because it (or its
dependencies) are missing. Check your build definition for missing or
conflicting dependencies. (Re-run with -Ylog-classpath
to see the
problematic classpath.) A full rebuild may help if 'Alert.class' was
compiled against an incompatible version of
javafx.scene.control. ageofscala Unknown Scala Problem
我收到了 23 个错误。
我在我的项目中使用 scalaFx。在我切换到较新的 SDK 之前,该项目 运行 非常完美。现在它甚至 运行 不支持旧版 SDK。因为我切换到较新的 SDK 的原因是这个错误:Eclipse returns error message “Java was started but returned exit code = 1” 所以我将这一行添加到 eclipse.ini 文件中:
-vm
C:/Program Files/Java/jdk1.8.0_25/jre/bin/server/jvm.dll
这是我的 build.sbt :
scalaVersion := "2.11.8"
libraryDependencies += "com.typesafe" % "config" % "1.2.1"
libraryDependencies += "com.github.nscala-time" %% "nscala-time" % "2.12.0"
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.4.4"
libraryDependencies += "com.lambdaworks" %% "jacks" % "2.3.3"
libraryDependencies += "com.typesafe.play" % "play_2.11" % "2.5.3"
libraryDependencies += "org.scala-lang" % "scala-swing" % "2.11.0-M7"
libraryDependencies += "org.scalafx" % "scalafx_2.11" % "8.0.92-R10"
是版本问题还是其他问题?我尝试将项目更新到最新的 Scala 版本 ("2.12.1"
) 和最新的 ScalaFx 版本 ("org.scalafx" %% "scalafx" % "8.0.102-R11"
) 但没有成功...
谁能帮帮我吗?谢谢!
在 Java 8u40 中添加了警报。你有 8u25。您需要将 Java 的版本更新到更新的版本。
我从 SDK 版本 scala-SDK-4.4.1-vfinal-2.11-win32.win32.x86_64
切换到版本 scala-SDK-4.5.0-vfinal-2.11-win32.win32.x86_64
后,我在 eclipse 中收到一些错误消息:
完整的错误信息:
missing or invalid dependency detected while loading class file 'Alert.class'. Could not access term Alert in package javafx.scene.control, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with
-Ylog-classpath
to see the problematic classpath.) A full rebuild may help if 'Alert.class' was compiled against an incompatible version of javafx.scene.control. ageofscala Unknown Scala Problem
我收到了 23 个错误。
我在我的项目中使用 scalaFx。在我切换到较新的 SDK 之前,该项目 运行 非常完美。现在它甚至 运行 不支持旧版 SDK。因为我切换到较新的 SDK 的原因是这个错误:Eclipse returns error message “Java was started but returned exit code = 1” 所以我将这一行添加到 eclipse.ini 文件中:
-vm
C:/Program Files/Java/jdk1.8.0_25/jre/bin/server/jvm.dll
这是我的 build.sbt :
scalaVersion := "2.11.8"
libraryDependencies += "com.typesafe" % "config" % "1.2.1"
libraryDependencies += "com.github.nscala-time" %% "nscala-time" % "2.12.0"
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.4.4"
libraryDependencies += "com.lambdaworks" %% "jacks" % "2.3.3"
libraryDependencies += "com.typesafe.play" % "play_2.11" % "2.5.3"
libraryDependencies += "org.scala-lang" % "scala-swing" % "2.11.0-M7"
libraryDependencies += "org.scalafx" % "scalafx_2.11" % "8.0.92-R10"
是版本问题还是其他问题?我尝试将项目更新到最新的 Scala 版本 ("2.12.1"
) 和最新的 ScalaFx 版本 ("org.scalafx" %% "scalafx" % "8.0.102-R11"
) 但没有成功...
谁能帮帮我吗?谢谢!
在 Java 8u40 中添加了警报。你有 8u25。您需要将 Java 的版本更新到更新的版本。