Modify

Opened 6 months ago

Closed 4 months ago

Last modified 4 months ago

#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)

openjfx.patch (2.2 KB ) - added by sebastic 6 months ago.
24339.patch (2.9 KB ) - added by Crashillo 4 months ago.

Download all attachments as: .zip

Change History (9)

by sebastic, 6 months ago

Attachment: openjfx.patch added

comment:1 by stoecker, 4 months ago

Resolution: fixed
Status: newclosed

In 19419/josm:

fix #24339 - don't use JavaFX when not installed

comment:2 by Crashillo, 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"

Last edited 4 months ago by Crashillo (previous) (diff)

comment:3 by sebastic, 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 stoecker, 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 Crashillo, 4 months ago

Attachment: 24339.patch added

comment:5 by Crashillo, 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:6 by stoecker, 4 months ago

In 19430/josm:

see #24339 - allow to extend module path for start script

in reply to:  5 comment:7 by stoecker, 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.