关于java Point2D的小问题

关于java Point2D的小问题

问题描述:

看的Java语言程序设计基础篇第10版
书第9章第6节3中的程序清单9-5中用了Point2D类。在引用时写的是:
import javafx.geometry.Point2D
我用的是Eclipse,提示

 Multiple markers at this line
    - The import javafx.geometry.Point2D is never used
    - Access restriction: The type 'Point2D' is not API (restriction on required library 'D:\java\jdk1.8.0_45\jre\lib\ext
     \jfxrt.jar')

后来查java的文档Java Platform Standard Edition 8 Documentation,写的是
java.awt.geom.Point2D
这是咋回事?书上写错了吗?

这是因为这个类是Eclipse的JRE带的,但并不属于JAVA的公开API。
解决方法:
右击项目->属性->Java Compiler->Errors/Warnings->Deprecated and restricted API->Forbidden reference -> Ignore