Access restriction: The type 'xxx' is not API (restriction on required library)

javafx 文章 2022-03-15 09:10 702 0 全屏看文

AI助手支持GPT4.0

用javafx的时候爆的异常。

Access restriction: The type 'WebEngine' is not API (restriction on required library 'C:\Program Files\Java\jdk1.8.0_202\jre\lib\ext\jfxrt.jar')

解决方案:

  1. eclipse里 点击项目目录右击,选择【properties】

  2. 选择java Build Path

  3. 选择 libraries

  4. 选择jre 然后右边remove

  5. Add Library

  6. 选择本地的JDK 点Apply


image.png

就可以正常提示类了。

-EOF-

AI助手支持GPT4.0