title: Access restriction on JavaFX classes in Eclipse Oxygen
body: <p>I'm using Eclipse Oxygen 4.7.0 in Ubuntu 17.04 with Oracle JDK 8u144. </p>
  
  <p>Any code that refers to JavaFX classes in packages <code>javafx.*</code>, e.g. <code>javafx.application.Application</code> is (incorrectly) reported as an error</p>
  
  <pre><code>Access restriction: The type 'ScrollPane' is not API (restriction on required library '/opt/jdk1.8.0_144/jre/lib/ext/jfxrt.jar')
  </code></pre>
  
  <p>This appears to be related to the "Java System Library" JavaSE-1.8. The <code>jfxrt.jar</code> has "Access rules" you can view in Properties -> Java Build Path, these only permit javax/<em>, java/</em>, org.w3c.* etc, none of which are even in the <code>jfxrt.jar</code>. </p>
  
  <p>I can workaround this issue in two different ways</p>
  
  <ul>
  <li>Changing Preferences -> Java -> Compiler -> Errors and Warnings -> Deprecated and Restricted API -> Forbidden Reference (access rules) to not be an error.</li>
  <li>Manually changing the system library from "JavaSE-1.8" to "Workspace default JRE" via Properties -> Java Build Path -> JRE System Library -> Edit </li>
  </ul>
  
  <p>Neither of these methods is ideal as I have a large number of Eclipse projects to tweak, and would prefer the forbidden reference checks are left enabled to catch genuine errors. </p>
  
  <p>Note this is also an issue when importing projects via the standard Gradle Import plugin included in Eclipse.</p>
  
  <p>Is there anyway to avoid this issue, perhaps via Gradle configuration, or is a known bug/feature that will be fixed? </p>