2015-02-16 4 views
5

Sono nuovo di Scala e SBT quindi potrei mancare qualcosa di ovvio.ScalaFX: errore di compilazione HelloWorld

stavo cercando di compilare l'esempio HelloWorld su http://www.scalafx.org/docs/quickstart/

ho creato un file contenente build.sbt:

scalaVersion := "2.11.5" 

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

e un file contenente il codice src/main/scala/ScalaFXHelloWorld.scala dalla pagina collegata.

Tuttavia, durante l'esecuzione sbt run ottengo:

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

Io corro SBT 0.13.7 e 2.11.5 scala su OpenJDK 1.8.0_31 su Archlinux

+0

OpenJDK 8 include JavaFX? Commenti sulla risposta accettata di [questa domanda] (http://stackoverflow.com/questions/18547362/javafx-and-openjdk) suggeriscono che non è così. – Jesper

+0

Lo penso. In quel documento si dice "Per JavaFX 8 (distribuito con Java 8) è necessario aggiungere dipendenza su ScalaFX v.8." – kvbx

+0

Beh, penso che tu abbia ragione. JavaFX non è nelle mie distribuzioni OpenJDK8. Sto installando openjfx da AUR ora. E poi ci riproverò. – kvbx

risposta

5

JavaFX non è parte di OpenJDK 8. Ho installato openjfx. Lavori. (Grazie Jasper)