JavaFX issue (Eclipse)

+2 Wilford Ice Brimley · January 11, 2015
So I am reading a book called, "Introduction to Java programming comprehensive version 10th edition" by y. Daniel Liang (good book btw!) and ran into an issue when reading the chapter that introduces javafx. Liang starts off by importing the javafx.application.Application, so I do this and I get an error "Access restriction: The type 'Application' is not API (restriction on required library 'C:\Program Files\Java\jre1.8.0_20\lib\ext\jfxrt.jar')". I'm not sure what this error means. Any help that would allow me to import Application would be great!


Post a Reply


Oldest  Newest  Rating
0 Branislav Lazic · January 16, 2015
I had a same issue. Obviously Eclipse bug. Use IntellijIDEA. It's way more ahead of Eclipse when it comes to JavaFX UI toolkit.
0 Kuroodo Ditory · January 16, 2015
Though I don't think this will fix your problem... try pressing ctrl+shift+O . This will auto-import stuff that is needed. It might just import the proper JavaFX package needed.
+1 Branislav Lazic · January 16, 2015
Ctrl + Shift + O will not fix that problem.
0 Stefan Baiu · April 29, 2015
Had the same problem. Here's how I solved it: 
Go to Package Explorer.  Right click on JRE System Library and go to Properties. In the Classpath Container > Select JRE for the project build path select the third option (Workspace default JRE).

(note: I'm using Eclipse Luna)
0 Damn It · May 6, 2015
Do you have a step by step tutorial on installing using Ubuntu terminal ? 
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator