NOTE: This document is outdated. The new JavaFX Public Preview SDK don't need any of the following steps.
Read through this only if you are still using the JavaOne 2008 preview version of JavaFX SDK.
Read through this only if you are still using the JavaOne 2008 preview version of JavaFX SDK.
If you just follow the installation guide on OpenJFX site, and generate your first sample project, you will get an error similar to this when you try to build and run the project:
Exception in thread "main" java.lang.NoSuchMethodError: com.sun.tools.javac.main.RecognizedOptions.getJavacFileManagerOptions(Lcom/sun/tools/javac/main/RecognizedOptions$OptionHelper;)[Lcom/sun/tools/javac/main/JavacOption$Option;
It is very easy to resolve this issue. Simply follow the steps posted in java.net Forums.
1. Go to your home directory, cd .netbeans/6.1
2. Edit the build.properties file, find a line says platforms.default_fx_platform.bootclasspath
3. Add the JavaFX jar file in the beginning so it look like
platforms.default_fx_platform.bootclasspath=/Users/(your_user_name_here)/.netbeans/6.1/modules/ext/compiler/lib/javafxc.jar: ...
4. Add import javafx.ui.* in the beginning of your generated JavaFX source code.
5. Restart Netbeans.
No comments:
Post a Comment