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;
If this is your case also, you can do fix this by simply right-clicking on the javaFX project folder-> Build Path-> Configure Build Path-> Select JavaFX SDK-> Remove library-> Select classpath -> add library-> user library-> select library-> apply. Save this answer.
I had the same problem, until I installed the JDK 1.8.0_60. That's right, installing the latest JDK helped!
After you install the latest JDK, change the settings on the Eclipse There are two steps to the process:
Select the appropriate JRE in Eclipse > Preferences > Java > Installed JREs
as shown here:
Project > Properties > Java Build Path
, Add Library as depicted below:
I got the same problem on Eclipse (MacOSX Yosemite) this morning but yesterday everything worked... To solve the problem I just deselected the checkbox for another JDK in Project > Properties > Java Build Path
restarted Eclipse, reselected the good one (JDK 1.8.0_60), restarted Eclipse again and voilà ! Just a weird bug with checkboxes...
Hope it ll help you.
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