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

1

2

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?

Declassify answered 29/4, 2016 at 9:18 Comment(4)
Have you imported the module? see #36911246Uneventful
Did you finally got that working? I am stuck with the same problem.Resistance
@Uneventful hmm .. I think that question is slightly different: I have no modules of my own, I'm compiling for java8Declassify
@Resistance no, I gave up for now - can develop against java8 and move up to java9 later (using a patch layer)Declassify
D
0

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> 
Daffy answered 29/4, 2016 at 11:13 Comment(2)
hmm .. the access rules are working for 8, but not for 9. Or what am I missing?Declassify
true - the setting compiles 8 only :-(Daffy

© 2022 - 2024 — McMap. All rights reserved.