ScalaFX:HelloWorld编译错误 [英] ScalaFX: HelloWorld compilation error

查看:214
本文介绍了ScalaFX:HelloWorld编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Scala和SBT的新手,所以我可能缺少明显的东西.

I'm new to Scala and SBT so I might be missing something obvious.

我试图在 http://www.scalafx.org/docs/上编译HelloWorld示例快速入门/

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

I created a file build.sbt containing:

scalaVersion := "2.11.5"

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

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

and a file src/main/scala/ScalaFXHelloWorld.scala containing the code from linked page.

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

However, when running sbt run I get:

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

I'm running sbt 0.13.7 and scala 2.11.5 on openjdk 1.8.0_31 on Archlinux

推荐答案

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

JavaFX isn't part of OpenJDK 8. I installed openjfx. Works. (Thanks Jasper)

这篇关于ScalaFX:HelloWorld编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆