Friday, October 6, 2017

Get Rid Of Eclipse Warning Messages on JavaFX API

When I was writing a Java program with JavaFX API, Eclipse complained loudly although the application runs smoothly since JavaFX is part of Java 8. The warning messages are very annoying. An example message is as follows,

Access restriction: The type 'Application' is not API (restriction on required 
library 'C:\Applications\Java\jdk1.8.0_144\jre\lib\ext\jfxrt.jar')

Since a picture is worth 1000 words, below is a screen shot showing the messages,

To get rid of the messages, the easiest way, perhaps, is to install the e(fx)clipse plugin for Eclipse.  To install it, one may follow the steps below,

  1. Start Eclipse. The rest of steps are operations on Eclipse.
  2. Select "Help" from the menu
  3. Select "Install New Software"
  4. On the "Available Software" pop-up window, select "All available sites" for the "Work with:" field.
  5. Type "e(fx)clipse" as the filter text or/and check "e(fx)clipse" under "General Purpose Tools" 
  6. Select "Next" or "Finish" to install it.  Following the instruction to accept the license term and restart Eclipse

After Eclipse restarts, the warning messages should go away.