Eclipse/java9-jigsaw: how to access javafx package

2019-05-27 09:47发布

My context:

  • 9-ea-113 (that is javafx now fully modularized, without jfrt.jar)
  • eclipse-neon-M6 with the current beta support for java9 (running on java8, if that matters)
  • win7

Something simple like

import javafx.application.Application;

public class FirstApplication extends Application {
    //
}

doesn't compile because the javafx.xx packages are not found.

What to do?

1条回答
在下西门庆
2楼-- · 2019-05-27 09:56

Edit the .classpath file of the project and add the entry below - seems to work.

  <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> 
查看更多
登录 后发表回答