#24339 closed defect (fixed)
Don't use openjfx unconditionally in the josm launchers
| Reported by: | sebastic | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 25.06 |
| Component: | Ubuntu package | Version: | tested |
| Keywords: | Cc: |
Description
The Debian package is not built with OpenJFX because it was buggy, while it's back in testing at time of writing the package is not in great shape. It's still the same version as in bookworm, not keeping up with newer JREs.
The launchers should not assume that the javafx modules can be loaded, they should only do that when the JAVAFX_HOME directory exists per the attached patch.
Attachments (2)
Change History (9)
by , 6 months ago
| Attachment: | openjfx.patch added |
|---|
comment:1 by , 4 months ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 4 months ago
The change introduced in https://josm.openstreetmap.de/changeset/19419/josm conditionally adds the --module-path parameter when JAVAFX is present. However, this approach introduces a limitation: OpenJDK only allows a single --module-path argument in the command line. This means that if another module path needs to be added — for example, to include additional modules like GraalJS for the Scripting plugin — it becomes impossible to do so via JAVA_OPTS.
A solution could be something like this:
if [[ -e "${JAVAFX_HOME}" ]]; then
if [[ -n "$JAVA_EXTRA_MODULE_PATH" ]]; then
FULL_MODULE_PATH="${JAVAFX_HOME}:${JAVA_EXTRA_MODULE_PATH}"
else
FULL_MODULE_PATH="${JAVAFX_HOME}"
fi
JAVA_OPTS="--module-path ${FULL_MODULE_PATH} --add-modules java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web $JAVA_OPTS"
else
JAVA_OPTS="--add-modules java.scripting,java.sql $JAVA_OPTS"
fi
In a way you could do: export JAVA_EXTRA_MODULE_PATH="/path/to/graaljs"
comment:3 by , 4 months ago
This sounds like a new feature to be tracked in its own ticket, as the launcher before r19419/josm unconditionally added the --module-path parameter. You might have abused JAVAFX_HOME to contain multiple paths then, that only worked by accident, not by design.
comment:4 by , 4 months ago
If you want that, please provide a full patch. You example forgets the else case.
I'd suggest to name the variable JOSM_MODULEPATH, as that's a JOSM specific setting.
by , 4 months ago
| Attachment: | 24339.patch added |
|---|
follow-up: 7 comment:5 by , 4 months ago
I just provided a patch, you can find it in the attachments section. I'm not used to work with svn, so patch comes from a git diff. This is my first code contribution, sorry if this is not the way.
comment:7 by , 4 months ago
Replying to Crashillo:
I'm not used to work with svn, so patch comes from a git diff. This is my first code contribution, sorry if this is not the way.
That's exactly how it should be.



In 19419/josm: