The import javafx.scene.control.Alert cannot be resolved

后端 未结 3 888
野趣味
野趣味 2021-02-18 23:19

I am getting the error with following two imports in Eclipse:

import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;

T

相关标签:
3条回答
  • 2021-02-18 23:53

    You need to change the java version. Java 1.8.0_45 do not include javafx.scene.control.Alert You can download version 1.8.0_221 here

    0 讨论(0)
  • 2021-02-18 23:58

    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:

    1. Select the appropriate JRE in Eclipse > Preferences > Java > Installed JREs as shown here:

      1. In Project > Properties > Java Build Path, Add Library as depicted below:
    0 讨论(0)
  • 2021-02-19 00:10

    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.

    0 讨论(0)
提交回复
热议问题