I have a fresh install of Java 8 (JDK 1.8.0_05 on Windows 7 32 bit) and Eclipse Luna. When I try to build a simple JavaFX program Eclipse shows the following message in the editor:
Access restriction: The type 'Application' is not API('C:\Program Files\Java\jre8\lib\ext\jfxrt.jar')
If I use the javac on the command line to compile the program every thing works fine.
Any hints how to solve this Problem?
The project doesn't support the JavaFX syntax. We need to export the JavaFX jar files to the project in order to run the JavaFX application. Just Right click on the project and select properties from the options. Go to Java Build Path → Libraries.
In this JavaFX Tutorial, JavaFX has been successfully installed on Eclipse.
Finally , adding Access rules on ".classpath" file in eclipse project solved this issue for me.
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<accessrules>
<accessrule kind="accessible" pattern="javafx/**"/>
</accessrules>
</classpathentry>
This solved the problem for me:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With