I am getting the error with following two imports in Eclipse:
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
The errors are: "The import javafx.scene.control.Alert cannot be resolved" and same is true for the 2nd import statement.
I am using Eclipse Version: Luna Service Release 2 (4.4.2) and have installed e(fx)clipse with latest JDK 1.8 (1.8.0_45).
There is no problem with other javafx related import statements, such as
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.input.MouseEvent;
1.8.0.45
+. My steps below: 1. install the right JDK (1.8.0_45 +),mine 1.8.0_60. 2.update my path variable to new JAVA_HOME && JDK's \jre\bin directory. 3.open eclipse(version 4.4+ supportjava8
)->window->preferences-> java->Installed JREs,click the edit btn in the right panel to update the directory to new jdk's bin ,mine isD:\Program Files\Java\jdk1.8.0_65
,then all fixed :) [ps. The last step fixed Nadeem's problem about eclispe still use the old JRE.] – Hardwood