我在 Eclipse 中遇到以下两个导入错误:
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
错误是:“导入javafx.scene.control.Alert无法解析“第二个导入声明也是如此。
我正在使用 Eclipse 版本:Luna Service Release 2 (4.4.2) 并安装了带有最新 JDK 1.8 (1.8.0_45) 的 e(fx)clipse。
其他javafx相关的import语句没有问题,比如
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.input.MouseEvent;
I had the same problem, until I installed the JDK 1.8.0_60. That's right, installing the latest JDK helped!
安装最新的JDK后,更改Eclipse上的设置
该过程有两个步骤:
-
Select the appropriate JRE in Eclipse > Preferences > Java > Installed JREs
as shown here:
- In
Project > Properties > Java Build Path
, Add Library as depicted below:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)