Gus Long
Gus Long

Reputation: 451

JavaFX classes are not recognised in Eclipse

I am a relative newbie to programming, I have a bit of experience building Swing apps and I now want to try my hand at learning JavaFX. I am using Eclipse Kepler as my IDE.

I understood from the JavaFX website that JavaFX is included in the JDK7 - Quote: "The first step in getting started with JavaFX is to download and install the Java SE 7 JDK, which includes the JavaFX runtime libraries and utilities. See the JDK 7 and JRE 7 Installation Guide for instructions."

However, when I try to import the Oracle JavaFX HelloWorld example (http://docs.oracle.com/javafx/2/get_started/hello_world.htm) into an Eclipse project I get errors on the JavaFx package imports. The only suggestions I get are to create new classes etc or 'search repositories for javafx.application'

Does this mean that Eclipse does not support JavaFX out of the box?

So my question to the community is two-fold: 1. please explain how to use JavaFX working in Eclipse. I checked out other answers which seem to indicate that I should install f(x)eclipse. But...

before you tell me that this is a duplicate question, my second question is please also help me understand how, when Oracle say that JavaFX is included in JDK7, it is not possible to import those packages regardless of the IDE (just like it is possible with Swing). Thanks

Upvotes: 1

Views: 1342

Answers (2)

tomsontom
tomsontom

Reputation: 5887

It is part of the JDK but not on a classpath hence extra work needed with Java7 - on Java8 it is on the ext-classpath - so the correct answer is - something being part of JDK does not mean it is on the classpath by default.

So tools like Eclipse need to take extra care of this.

Upvotes: 1

clumsy
clumsy

Reputation: 716

Since JDK 7 update 51 JavaFX is a part of JDK: release notes

Upvotes: 0

Related Questions