Hi Sven, So I tried to get the project into the state where the project's built classes are on both the classpath and module path and the project is run in the unnamed module, but unfortunately didn't succeed in that.
But I am not sure offhand why that should be problematic: unless there is a module-info under build/classes/ or build/classes/*/, then the --module-path .../build/classes is (AFAIK) effectively a no-op, no? And even if there was a module-info there, the module would not be part of the module graph unless added using either --add-modules or -m? Regarding the error - can JavaFX code run when it is in the unnamed module? (Which is what I think happens when it is on the classpath.) Seems that probably no, so it must be on the module path, and either the project using it must have a module-info, or something like "--add-modules javafx.base,javafx.controls,javafx.graphics" must be used (in both Build/Compiling/Additional Compiler Options and Run/VM options) to ensure the modules are in the module graph. Jan On Sat, May 12, 2018 at 9:18 PM, Sven Reimers <[email protected]> wrote: > Hi Jan, > > will try... > > I wanted to try the new JavaFX SDK 11 which provides JavaFX as JPMS > modules. > > I created a default Java Application (Ant based NetBeans project) using an > OpenJDK 11 build. Then I added the jar's to the classpath (not the module > path) and created a simple main class extending from > javafx.application.Application. Everything compiles fine, but running the > application fails with: > > Error: JavaFX runtime components are missing, and are required to run this > application > > This seems due to the fact that my main class is living on the module path > not on the classpath - as you can see by investigating the ant output: > > Execute:Java13CommandLauncher: Executing > '/Users/sven/tools/jdk-11.jdk/Contents/Home/bin/java' with arguments: > '-Dfile.encoding=UTF-8' > '-Duser.language=en' > '-classpath' > '/Users/sven/tools/javafx-sdk-11/lib/javafx.base.jar:/Users/ > sven/tools/javafx-sdk-11/lib/javafx.controls.jar:/Users/ > sven/tools/javafx-sdk-11/lib/javafx.graphics.jar:/Users/ > sven/NetBeansProjects/JavaApplication5/build/classes' > '--module-path' > '/Users/sven/NetBeansProjects/JavaApplication5/build/classes' > 'javaapplication5.NewMain' > > So you can see my NewMain class is loaded from the module path although I > never specified using the module path.... > > So this combination (which you will get as an OOTB experience will not > work... > > Hope this helps clarifying my problem. > > Thanks > > -Sven > > > > On Sat, May 12, 2018 at 8:45 PM Jan Lahoda <[email protected]> wrote: > > > Hi Sven, > > > > Not sure I understand what exactly you are doing and how - is there a > > chance you could describe in more detail what you are doing? > > > > Thanks, > > Jan > > > > On Sat, May 12, 2018 at 6:54 PM, Sven Reimers <[email protected]> > > wrote: > > > > > HI, > > > > > > I was just giving the new JavaFX SDK (http://jdk.java.net/openjfx/) a > > try > > > on Apache NetBeans 9.0 (nightly) using an OpenJDK 11 build as the > > platform > > > for the project. > > > > > > In a modular project everything works nice, but if I try to use this > in a > > > "normal" project it seems that the default is that the compiled sources > > are > > > put on the module path not on the classpath as the project type would > > > indicate. > > > > > > So the only way to get this working is to create a module-info.java and > > put > > > the sdk jar's on the module path. I think this is wrong - typically > > > everything should go on the classpath in this project type. > > > > > > Shall I file an issue? > > > > > > BTW. The project type JavaFXApplication will be not working anymore in > a > > > JDK 11 world, because JDK 11 without JavaFX can not be selected as a > > > platform.. > > > > > > -Sven > > > > > > > > -- > Sven Reimers > > * Senior Expert Software Architect > * Java Champion > * NetBeans Dream Team Member: http://dreamteam.netbeans.org > * Community Leader NetBeans: http://community.java.net/netbeans > Desktop Java: > http://community.java.net/javadesktop > * JUG Leader JUG Bodensee: http://www.jug-bodensee.de > * Duke's Choice Award Winner 2009 > > * XING: https://www.xing.com/profile/Sven_Reimers8 > * LinkedIn: http://www.linkedin.com/in/svenreimers >
