Modify ↓
#22833 closed defect (fixed)
[Patch] Command line environment variables are overwritten by /etc/default/josm
Reported by: | skyper | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 23.03 |
Component: | Ubuntu package | Version: | latest |
Keywords: | template_report | Cc: | sebastic |
Description (last modified by )
What steps will reproduce the problem?
- Enter
JAVA_OPTS="-Xmx256m -Djosm.home=/tmp/josm" josm
in the console.
What is the expected result?
JOSM starts with appropriate assigned memory and JOSM dirs plus all environment variables set in /etc/default/josm
and /usr/bin/josm
What happens instead?
All environment variables are present but the assigned memory value is taken from /etc/default/josm
.
Please provide any additional information below. Attach a screenshot if possible.
Changing the order of the argument and the variable in /etc/default/josm
seems to do the trick, e.g. JAVA_OPTS="${JAVA_OPTS} -Xmx768m"
to JAVA_OPTS="-Xmx768m ${JAVA_OPTS}"
.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2023-03-21 14:21:54 +0100 (Tue, 21 Mar 2023) Revision:18698 Build-Date:2023-03-22 02:31:00 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (18698 en) Linux Debian GNU/Linux 11 (bullseye) Memory Usage: 158 MB / 768 MB (41 MB allocated, but free) Java version: 17.0.6+10-Debian-1deb11u1, Debian, OpenJDK 64-Bit Server VM VM arguments: [--module-path=/usr/share/openjfx/lib, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, -Djosm.restart=true, -Djosm.dir.name=JOSM-latest, -Djava.net.useSystemProxies=true, -Djosm.home=<josm.pref>, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED]
Attachments (0)
Change History (6)
comment:1 by , 21 months ago
Cc: | added |
---|
comment:3 by , 21 months ago
Summary: | Command line arguments are overwritten by /etc/default/josm → [Patch] Command line environment variables are overwritten by /etc/default/josm |
---|
comment:4 by , 21 months ago
Description: | modified (diff) |
---|
comment:6 by , 21 months ago
Milestone: | → 23.03 |
---|
Note:
See TracTickets
for help on using tickets.
JAVA_OPTS
is an environment variable, not a commandline argument.Commandline arguments are passed after the
-jar
option using$@
:By default none of the options in
/etc/default/josm
are enabled:Using the environment variable works in this case:
Annoyingly
--status-report
doesn't exit like--version
and--help
.Setting the same option in
/etc/default/josm
and the environment is conflicting:The last one is used as its value overwrites its predecessors.
I don't think this is a bug, either set the option in
/etc/default/josm
or set on the commandline.A case can be made for prepending values to
JAVA_OPTS
like/usr/bin/josm
to use value set by the user instead the one set by the administrator.This patch could suffice: