简体   繁体   中英

setting sbt scalafx project

javafx is now in oracle-jdk.

scalafx gives delicious examples in its repository

The main questions I'm not being able to answer is "How to get started with scalafx"?

How can I add scalafx libary dependencies on my sbt project?

ScalaFX is soon to reach a stable release state. As I write this you can find the published artifacts for version 1.0.0-M2 on the maven central repo

Adding the dependency to your sbt build should suffice

libraryDependencies += "org.scalafx" %% "scalafx" % "1.0.0-M2"

I did it the following way: I cloned the scalafx repository, build the jar using sbt package , then just copied the resulting jar into lib/ directory of my project. Make sure to reference your ${JAVAFX_HOME}/lib/jfxrt.jar as well.

If you want to use local maven, just run sbt publish-local in your scalafx dir, then add the following dependency to your project:

"org.scalafx" % "scalafx" % "1.0-SNAPSHOT"

(Look up that version in scalafx build.sbt, I pasted what was in mine)

@ayvango i have created a giter8 scalafx project template.just use

  g8 jugchennai/scalafx.g8

You just need a new version of JDK, Giter8 and SBT. Dependency settings for javafx, scala, scalafx are predefined! IDE support also available.

URL : https://github.com/jugchennai/scalafx.g8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM