Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting started instructions for modular NetBeans project produce an invalid image #68

Closed
vic0824 opened this issue Jan 9, 2019 · 3 comments

Comments

@vic0824
Copy link

vic0824 commented Jan 9, 2019

I have followed the instructions contained in the getting started page, creating a modular project in Netbeans ("Modular from IDE" section).
In particular, I have followed the instructions contained in Section 6 to add the JavaFX jmods to the module path, but it seems that the jmods have not been used to create the image. When I run it, I get the error on the initialisation of the quantum renderer.
The output of the Ant build file is also suspicious, because it mentions the JavaFX jars instead of the jmods:

To run this application from the command line without Ant, try:
C:\Program Files\Java\jdk-11.0.1/bin/java -modulepath C:\Program Files\Java\javafx-sdk-11.0.1\lib\javafx-swt.jar;C:\Program Files\Java\javafx-sdk-11.0.1\lib\javafx.base.jar;C:\Program Files\Java\javafx-sdk-11.0.1\lib\javafx.controls.jar;C:\Program Files\Java\javafx-sdk-11.0.1\lib\javafx.fxml.jar;C:\Program Files\Java\javafx-sdk-11.0.1\lib\javafx.graphics.jar;C:\Program Files\Java\javafx-sdk-11.0.1\lib\javafx.media.jar;C:\Program Files\Java\javafx-sdk-11.0.1\lib\javafx.swing.jar;C:\Program Files\Java\javafx-sdk-11.0.1\lib\javafx.web.jar;C:\Users\VTorroni\OneDrive - Serco\SW Projects\_libs\jexcelapi-2.6.12\modules\jxl.jar;C:\Users\VTorroni\Documents\NetBeansProjects\CryoStats\build\modules;C:\Program Files\Java\javafx-jmods-11.0.1 cryostats.CryoStats
deploy:
jar:
BUILD SUCCESSFUL (total time: 10 seconds)

If I follow the instructions for Eclipse, the image runs fine. The difference between the two images is that the image generated by NetBeans does not contain the following files:

  • decora_sse.dll
  • glass.dll
  • javafx_font.dll
  • javafx_iio.dll
  • prism_common.dll
  • prism_d3d.dll
  • prism_sw.dll
@jperedadnr
Copy link
Contributor

You can try the sample linked at that section: https://github.com/openjfx/samples/tree/master/IDE/NetBeans/Modular/Java

and see if you still have the same issue. Probably you are missing some configuration step.

@vic0824
Copy link
Author

vic0824 commented Jan 18, 2019

The sample project downloaded from github works.
I have compared the project files and found a crucial difference.
In the project.properties file of the sample project from github, the run.modulepath property has the following value:

run.modulepath=\
    ${libs.JavaFXMODS11.classpath}:\
    ${javac.modulepath}:\
    ${build.modules.dir}

whereas the run.modulepath property generated by NetBeans following the instructions in the tutorial is:

run.modulepath=\
    ${javac.modulepath}:\
    ${build.modules.dir}:\
    ${libs.JavaFXMODS11.classpath}

Apparently, the order in which the paths are specified is important: if I move ${libs.JavaFXMODS11.classpath} at the beginning of the string, the packaging step generates a correct image.
Given that this file is generated automatically by NetBeans, I wonder how it is possible that the order is different in the sample project.

@jperedadnr
Copy link
Contributor

jperedadnr commented Apr 17, 2019

Yes, the order is important, indeed. However, the order can be modified when you add the library.

See updated document https://openjfx.io/openjfx-docs/#IDE-NetBeans, section Modular from IDE:

Add this library to NetBeans -> Properties -> Libraries -> Run -> Modulepath and place it on top.

and sample:

run.modulepath=\
    ${libs.JavaFXMODS12.classpath}:\
    ${javac.modulepath}:\
    ${build.modules.dir}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants