Everywhere that I read, as of Java 7u7, JavaFX2 is bundled with the JRE and JDK. So I am confused as to why when I run Eclipse, it tells me "The import javafx cannot be resolved".
I have no other JDKs or JREs installed but 7u9, so why would I not be able to see JavaFX2 from Eclipse?
Many thanks :)
Eclipse is a Java-based application and, as such, requires a Java Runtime Environment or Java Development Kit (JRE or JDK) in order to run. Note that on recent versions of Mac, a full JDK needs to be installed, not just a JRE; see instructions below.
If you've installed Eclipse but are having trouble getting it to run, the most likely cause is that you have not correctly specified the JVM for it to run under. Eclipse startup is controlled by the options in $ECLIPSE_HOME/eclipse. ini. If $ECLIPSE_HOME is not defined, the default eclipse.
Unfortunately, for jdk7u9, Eclipse does not add the jfxrt.jar
file from your jre\lib
directory to the project build path libraries when we create a new Java project. You have to do it manually or you can install the e(fx)clipse plugin to Eclipse, which will make your JavaFX development easier :)
Eclipse is following the default settings for the JRE 7u9 default boot classpath (which is to not include jfxrt.jar
). A future JRE version will place jfxrt.jar
on the boot classpath so you won't need to manually add the jfxrt.jar
file to project build path libraries. You can track this JRE feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With