算法(Sidgwick,Wayne第四版)导入该书库文件后报"Access restriction: The type 'StdDraw' is not API 错的解决方案

首先,在你报“Access restriction: The type ‘xxx’ is not API”(xxx代表导入的某个类)错的那个project里右键JRE System LIbrary,再点击Proprties
算法(Sidgwick,Wayne第四版)导入该书库文件后报"Access restriction: The type 'StdDraw' is not API 错的解决方案
之后,将System libraary里的
Execution enviroement改为Alternate 或者Workspace default JRE(关键应该在于Alternate 或者Workspace default JRE是导入书中类库的那个JRE。我的导入的类库在Java的jdk目录下,也就是Java\jdk1.8.0_201\jre\lib\ext,所以我选择Alternate JRE中的jdk1.8.0_201。但是,我有个疑问:Execution enviroement 的jdk版本选择的也是导入的jdk的版本,为什么会报错???
算法(Sidgwick,Wayne第四版)导入该书库文件后报"Access restriction: The type 'StdDraw' is not API 错的解决方案

最后,选择Apply and Close就完成了。