Skip to main content

Unable to use javafx on OSX

6 replies [Last post]
jfchevrette
Offline
Joined: 2008-12-01
Points: 0

Hello,

I have tried many things such as changing my java version, compile openjfx manually, etc... and I still cannot get it to work on OSX.

-- hello.fx --
println ("hello world")

$ javafxc hello.fx
hello.fx:1: cannot find symbol
symbol : variable println
location: class hello
println("hello, world.")
^
1 error

JAVA_HOME is set properly to java 1.6.0_07

$ echo $JAVA_HOME
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
jfcbook:javafx jfchevrette$ $JAVA_HOME/bin/java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

Any ideas?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexsch
Offline
Joined: 2007-07-12
Points: 0

Try the code:

[code]
import java.lang.System;
System.out.println("Hello World!");
[/code]

jfchevrette
Offline
Joined: 2008-12-01
Points: 0

That does work indeed, but that code is standard java....

I'm following the guide at http://www.ociweb.com/jnb/jnbDec2008.html

michael_heinrichs
Offline
Joined: 2007-11-15
Points: 0

Which version of the compiler are you using?

jfchevrette
Offline
Joined: 2008-12-01
Points: 0

I have downloaded the latest SDK preview from javafx.com

$ javafxc -version
javafxc 1.0-internal

michael_heinrichs
Offline
Joined: 2007-11-15
Points: 0

The functionality to use the println-method directly was introduced in a later version of the compiler (which was apparently used for the article). You either have to use the old, long format or wait for the 1.0 release.

jfchevrette
Offline
Joined: 2008-12-01
Points: 0

Thanks for the info!

I have replaced the Preview SDK with the latest openjfx-compiler artifact build and the code now works!