4

I installed OpenJDK 11 and OpenJFX 11, and managed to build and run a JavaFX application. However, I was only able to run it after adding --module-path and --add-modules arguments in the command line.

How can I set up OpenJFX so that it is available by default to any application (without extra arguments), like with Oracle's JDK version 8?

  • @murkle thanks, I had actually found ZuluFX, but they didn't have version 11 available for Linux when I posted this question. In the meantime I contacted them and they added it. I am guessing they are doing something similar to the solution I found. – aditsu quit because SE is EVIL Jun 08 '19 at 09:16

1 Answers1

-1

I think I found a way to do it. It's probably not advisable and may break things, but here it is anyway (note that I'm using Linux):

  1. Get and extract the OpenJFX SDK and jmods. Following steps are relative to the root directory of the OpenJDK
  2. Copy *.so from the OpenJFX's lib directory to lib (OpenJDK's lib directory)
  3. Copy all the javafx jmod files to jmods
  4. Run bin/jlink --module-path jmods --add-modules `ls -1 jmods|sed s/\\.jmod//|paste -sd ,` --output jfx (the command between backticks makes a comma-separated list of all the jmods without the .jmod extensions)
  5. Move jfx/lib/modules to lib/modules (you can rename the original one first as a backup)
  6. Delete the jfx directory