Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#21689 closed defect (wontfix)

Extra arguments for /usr/bin/josm

Reported by: aumpfbahn@… Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:


According to you can set a different directory to handle the with a single line:

java -Djosm.home=JOSM-imports -jar josm.jar

Since unix wraps all the java stuff with the /usr/bin/josm launcher, you may think that the following code should work, but:

$ josm -Djosm.home=JOSM-imports
Using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to execute josm.
JOSM: unrecognized option '-Djosm.home'

I figured out that is the responsible for. But you can make it work just switching the "extra arguments" position like this:

- $JAVACMD $JAVA_OPTS -jar /usr/share/josm/josm.jar "$@"
+ $JAVACMD $JAVA_OPTS "$@" -jar /usr/share/josm/josm.jar

Is there any issue about switching the "$@" position that I'm missing? IMO, that would simplify the things a lot, keeping the java stuff wrapped.

Thanks in advance

Attachments (0)

Change History (3)

comment:1 Changed 18 months ago by stoecker

Resolution: wontfix
Status: newclosed

Well. This change makes it impossible to pass any option to josm:

java --language=en -jar josm-custom.jar

Unrecognized option: --language=en

If you want to add custom java arguments I suggest to use another wrapper, e.g. stored in your $HOME/bin dir.

Last edited 18 months ago by stoecker (previous) (diff)

comment:2 Changed 18 months ago by aumpfbahn@…

I achieved an easier solution which doesn't envolve any extra wrapper, based on the .desktop unix files:

Duplicate the file /usr/share/applications/org.openstreetmap.josm.desktop and modify only these fields as follows:

[Desktop Entry]
Name=JOSM Imports
Exec=env JAVA_OPTS="-Djosm.home=JOSM-imports" josm %U

Just simple as that 🎉

comment:3 Changed 18 months ago by skyper

To make it work in the terminal you need this wrapper for /usr/bin/josm e.g. /usr/local/bin/josm-imports or $HOME/bin/josm-imports as @stoecker wrote.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.