John Vasiliou
John Vasiliou

Reputation: 997

JavaFX not compiling in Netbeans

I'm using Mac OS X, Netbeans 7.3 Beta 2 and JDK 7 u12.

Netbeans cannot see the JavaFX library. I thought that the JavaFX library comes with JDK 7?

Netbeans see's and uses JDK 7 (coming from JDK 6 I have now lost my retina icons and text!), but when I try and add a library there is no JavaFX library available.

I've gone through the steps shown on Netbeans website to configure and create a JavaFX application, which is where I found that for OS X I need JDK 7, but I have had no luck.

What am I missing?

Upvotes: 1

Views: 1292

Answers (2)

jewelsea
jewelsea

Reputation: 159291

jdk7u12 is still pre-release software and may be incompatible with NetBeans.

Specifically, a recent change in the JavaFX structure is HEADS-UP: jfxrt.jar moving to jre/lib/ext. If you try using jdk7u12 with a version of NetBeans coded before the JavaFX structure change (such as NetBeans 7.3 beta 2), it may not work out of the box. In the meantime, I suggest using a production version of the jdk (such as jdk7u11) until NetBeans update their software to work correctly with the relocated jfxrt.jar library.

I know you note that you have followed steps on the NetBeans website, but you don't link to them. Ensure that you have correctly configured a NetBeans JavaFX Platform as detailed in the NetBeans JavaFX setup tutorial (Although that tutorial is currently for NetBeans 7.1 and 7.2, hopefully it will also work for your 7.3 beta). Also, make sure that when you create your project, you create a "JavaFX Application" in NetBeans - as opposed to a regular "Java Application".

If you are still having issues, list your compile errors in your question.

when I try and add a library there is no JavaFX library available.

JavaFX is not configured as a library on NetBeans - it is part of a "JavaFX Platform" as detailed in the setup link in this answer.

coming from JDK 6 I have now lost my retina icons and text!.

Kind of unrelated, but JavaFX in JDK8 will support retina displays (scheduled release data Sept, 2013).

Upvotes: 1

James Weaver
James Weaver

Reputation: 113

John,

You might try posting your question on the Oracle JavaFX 2.0 and Later Forum: https://forums.oracle.com/forums/forum.jspa?forumID=1385

Please feel free to tweet the URL of your question to me @JavaFXpert and I'll follow up to make sure it gets answered.

Thanks, Jim Weaver

Upvotes: 1

Related Questions