flathub / org.openstreetmap.josm

https://flathub.org/apps/details/org.openstreetmap.josm
4 stars 3 forks source link

Allow passing Java arguments to the flatpak #103

Open marcel263 opened 2 months ago

marcel263 commented 2 months ago

Flatpak build 19067 from flathub

On https://josm.openstreetmap.de/wiki/Help/Preferences there are instructions that may be required for optimal usage of JOSM.

This flatpak does not allow passing java -D arguments. All arguments are passed as josm file arguments, it seems. As a result, the user cannot apply this instructions on the mentioned page:

-Djosm.dir.name=JOSM-dev

When running flatpak run org.openstreetmap.josm -Djosm.dir.name=JOSM-dev The output is: "JOSM: unrecognised option '-Djosm.dir.name'"

That is explained by the wrapper in /app/bin/josm. This wrapper inside the flatpak container does this:

        $JAVACMD $JAVA_OPTS -jar "${JOSM_PATH}" "$@"

Proposed solution: Parse better the arguments that are given. Arguments starting with '-D' could easily be detected and added to $JAVA_OPTS with a bit of extra shell code in the wrapper. Valid arguments for josm itself could be passed to josm.