Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScalaFX: HelloWorld compilation error

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

I was trying to compile the HelloWorld example on http://www.scalafx.org/docs/quickstart/

I created a file build.sbt containing:

scalaVersion := "2.11.5"

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

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

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>,
...
...

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

like image 855
kvbx Avatar asked Feb 16 '15 14:02

kvbx


1 Answers

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

like image 164
kvbx Avatar answered Nov 10 '22 18:11

kvbx