在OS X上为Java 7u7(包含JavaFX 2.2)编译scalafx [英] Compiling scalafx for Java 7u7 (that contains JavaFX 2.2) on OS X
问题描述
scalafx 的编译说明指出:
export JAVAFX_HOME=/Path/To/javafx-sdk2.1.0-beta
sbt clean compile package make-pom package-src
但是,随着JavaFX新包装作为Java JDK本身的一部分(即OS X为7u7),似乎不再有这样的"javafx-sdkx.x.x"文件夹. Oracle文档说JavaFX JDK与主要Java JDK放在同一文件夹中.
However, with the new packaging of JavaFX as part of the Java JDK itself (i.e. 7u7 for OS X) there no longer seems to be such a 'javafx-sdkx.x.x' folder. The Oracle docs say that JavaFX JDK is placed alongside the main Java JDK (in same folders).
所以我这样做:
$ export JAVAFX_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk
$ sbt clean
[warn] Using project/plugins/ (/Users/asko/Sources/scalafx/project/plugins) for plugin configuration is deprecated.
[warn] Put .sbt plugin definitions directly in project/,
[warn] .scala plugin definitions in project/project/,
[warn] and remove the project/plugins/ directory.
[info] Loading project definition from /Users/asko/Sources/scalafx/project/plugins/project
[info] Loading project definition from /Users/asko/Sources/scalafx/project/plugins
[error] java.lang.NullPointerException
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
我做错什么了吗?或者scalafx尚未与最新的Java版本(7u7,JavaFX 2.2)兼容.我该怎么办?
Am I doing something wrong or is scalafx not yet compatible with the latest Java release (7u7, JavaFX 2.2). What can I do?
http://code.google.com/p/scalafx/
附录
..最后(按照下面的Igor解决方案),sbt run
轻松启动彩色圆圈演示(好吧,如果一个人具有受支持的GPU). Oracle "JavaFX支持的声明狮子或更高版本的任何Mac OS X系统上的图形硬件加速".但我倾向于认为我所使用的NVidia驱动的Mac Mini可以进行软件渲染.
..and finally (following Igor's solution below) sbt run
launches the colorful circles demo easily (well, if one has a supported GPU that is). Oracle claims that "JavaFX supports graphic hardware acceleration on any Mac OS X system that is Lion or later" but I am inclined to think the NVidia powered Mac Mini I'm using does software rendering.
不,即使是本来可以快速使用Javafx的MacBook Air(酷睿i7)在演示中也很迟钝.也许是演示.
Nope, even the otherwise fast-with-javafx MacBook Air (core i7) is sluggish with the demo. Maybe it's the demo.
推荐答案
我所做的是:
hg clone https://code.google.com/p/scalafx/
cd scalafx
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home
sbt clean compile package make-pom package-src
有效. 似乎最新的代码签出包含对与SDK捆绑在一起的JavaFX的支持.检查build.sbt文件的第106行.
It works. It seems that the latest code checkout contains support for JavaFX bundled with the SDK. Check the build.sbt file, line 106.
这篇关于在OS X上为Java 7u7(包含JavaFX 2.2)编译scalafx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!