gpt4 book ai didi

ScalaFX:HelloWorld 编译错误

转载 作者:行者123 更新时间:2023-12-04 08:07:12 26 4
gpt4 key购买 nike

我是 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

最佳答案

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

关于ScalaFX:HelloWorld 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28543688/

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