Access restriction: the type ‘application’ is not API (restriction on required LIB)

When using eclipse to build JavaFX with jdk8 for the first time, a compiler error occurred

Access restriction: The type ‘Application’ is not API (restriction on required library ‘E:\JAVA\jdk1.8\jre\lib\ext\ jfxrt.jar ‘)

 

Solution: right click the project name — & gt; build path — & gt; configure build path — & gt; select JRE System Library — & gt; remove — & gt; add library to add system JRE library

 

Read More: