0

I'm using the latest version of Java jdk1.8.0_65 with the latest version of Eclipse Neon. I'm reading an introduction into Java programming book and the author uses JavaFX code that my Eclipse does not detect.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;

My IDE does not recognize any of these imports and the book just assumes my eclipse has them for some reason. How do I use JavaFX? Thanks in advance.

Davidh3
  • 15
  • 1
  • 1
  • 5
  • I have Eclipse Neon installed here and it resolves those packages/classes just fine. Are you sure you have Java 8 selected as your JDK? – Jim Garrison Jul 25 '16 at 05:26
  • Quick-fix: Set the correct JDK under your project properties -> build path -> libraries -> edit jre and point to jdk. – aw-think Jul 25 '16 at 07:28

1 Answers1

0

First of all JDK 8u102 is the latest version of Java and not the one you use but that should not be relevant here. On Mac and Windows it should be enough to install just the JDK and Eclipse without anything else in order to get JavaFX going. Only on Linux you have to be carefull because not all intallations come with JavaFX. I don't use Linux so you have to check that yourself and I can't give you any specific advice on that.

mipa
  • 10,369
  • 2
  • 16
  • 35