8

我是 Scala 和 SBT 的新手,所以我可能会遗漏一些明显的东西。

我试图在http://www.scalafx.org/docs/quickstart/上编译 HelloWorld 示例

我创建了一个文件build.sbt,其中包含:

scalaVersion := "2.11.5"

libraryDependencies += "org.scalafx" %% "scalafx" % "8.0.0-R4"

和一个src/main/scala/ScalaFXHelloWorld.scala包含链接页面代码的文件。

但是,运行时sbt run我得到:

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[info] Set current project to scalafx (in build file:/home/kvbx/Projects/ScalaFX/)
[info] Compiling 1 Scala source to /home/kvbx/Projects/ScalaFX/target/scala-2.11/classes...
[error] missing or invalid dependency detected while loading class file 'Color.class'.
[error] Could not access term javafx in package <root>,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'Color.class' was compiled against an incompatible version of <root>.
[error] missing or invalid dependency detected while loading class file 'Color.class'.
[error] Could not access term scene in value javafx,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'Color.class' was compiled against an incompatible version of javafx.
[error] missing or invalid dependency detected while loading class file 'Stage.class'.
[error] Could not access term javafx in package <root>,
...
...

我在 Archlinux 上的 openjdk 1.8.0_31 上运行 sbt 0.13.7 和 scala 2.11.5

4

1 回答 1

6

JavaFX 不是 OpenJDK 8 的一部分。我安装了 openjfx。作品。(感谢贾斯珀)

于 2015-02-16T15:54:46.297 回答