Search code examples
netbeansjavafx-2java-7netbeans-7.2

Netbeans 7.2/Jdk 7u7 bundle - javafx failure..jfxrt.jar issue


I have just done a fresh install of the netbeans 7.2/JavaFx2.2 SDK bundle downloaded from oracle. None of my old code will compile. This is the error I receive: (I know the code is good - consider bad code ruled out). Oddly enough, the javafx sample programs bundled with the Netbeans distribution run fine. I've wasted a day on this issue already. The classpath appears to be set fine. java -version returns "...( build 1.7.0_07 )

If someone could give me a step by step that would be just awesome.

Please HELP!

Copying 2 files to C:\Pro JavaFx Apress Code\Pro JavaFX 2\8727_ch05code\StarterApp\dist\lib Detected JavaFX Ant API version 1.2 C:\Pro JavaFx Apress Code\Pro JavaFX 2\8727_ch05code\StarterApp\nbproject\jfx-impl.xml:939: Error: jfxrt.jar needs to be on classpath for -createbss and for -createJar without -nocss2bin

Thanks, Marc


Solution

  • In NetBeans:

    1. Open your Project Properties
    2. Go to Build | Packaging
    3. Ensure that the option Binary Encode JavaFX CSS Files is not checked.

    The binary encoding of css files is only a minor performance optimization, even in a production release, it is probably unimportant (for instance, none of the css used in html webapps is binary encoded), so I wouldn't worry about leaving the binary encoding checkbox unchecked.

    I believe the error you see is just a bug in the combination of NetBeans and Java versions. Most likely, when JavaFX is placed by default on the Java classpath (probably jdk7u10) then the binary encoding of CSS in NetBeans will start working again as the JavaFX runtime jar (jfxrt.jar) will be found.