Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installed Java 7u9 and Eclipse (Juno) but Eclipse doesn't see JavaFX2

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 :)

like image 414
Geesh_SO Avatar asked Nov 21 '12 18:11

Geesh_SO


People also ask

Does Eclipse has inbuilt JDK?

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.

Why Eclipse is not opening?

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.


1 Answers

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.

like image 63
invariant Avatar answered Sep 20 '22 23:09

invariant