Eclipse/java9-jigsaw: how to access javafx packages?

泄露秘密 提交于 2020-01-02 09:13:02

问题


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:


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> 


来源:https://stackoverflow.com/questions/36934391/eclipse-java9-jigsaw-how-to-access-javafx-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!