wiki:Help/CommandLineOptions

Version 24 (modified by Hb---, 13 days ago) (diff)

--

Command Line Options

Starting JOSM is affected by three groups of command line options. Most important are the Programm arguments and also the Java options. The run-options are involved in Web Start only.

# Running a jar
java [Java options] -jar josm-tested.jar [Programm arguments]

# Web Start
javaws [run-options] josm.jnlp

Java Virtual Machine options::

Control the handler of virtual machine, for example --Xmx2048m. The --jar jarfile part is a java option, too. Control the environment inside the virtual machine for JOSM, for example -Djosm.home=/home/user/.josm_dev

WebStart run-options::

Control the startup of the handler, for example -J--Xmx2048m to hand over the string 'Xmx2048m' to the JVM

--offline

Programm arguments

Also called Post jar arguments here or args by Java. The order of these arguments behind the jarfile in the command line is important for some of them.

The first argument is the commmand for JOSM. The three possible commmands are one for normal work, one for image and one for something other. If JOSM can't recognize a command the default is assumed and the usual GUI is started.

The following arguments can be URLs, coordinates, options with own arguments and filenames. See the output of the --help option below.

--help|-h                                 Show this help
--geometry=widthxheight(+|-)x(+|-)y       Standard unix geometry argument
[--download=]minlat,minlon,maxlat,maxlon  Download the bounding box
[--download=]<URL>                        Download the location at the URL (with lat=x&lon=y&zoom=z)
[--download=]<filename>                   Open a file (any file type that can be opened with File/Open)
--downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw GPS
--downloadgps=<URL>                       Download the location at the URL (with lat=x&lon=y&zoom=z) as raw GPS
--selection=<searchstring>                Select with the given search

--[no-]maximize                           Launch in maximized mode
--reset-preferences                       Reset the preferences to default
--load-preferences=<url-to-xml>           Changes preferences according to the XML file
--set=<key>=<value>                       Set preference key to value
--language=<language>                     Set the language
--version                                 Displays the JOSM version and exits
--debug                                   Print debugging messages to console
--skip-plugins                            Skip loading plugins
--offline=<osm_api|josm_website|all>      Disable access to the given resource(s), separated by comma

Make sure you load some data if you use --selection. The --offline list may have commata between its items osm_api,josm_website.

Java options

These options are sometimes called JOSM JV options in this help or VM arguments in the JOSM status report.

provided as Java system properties

-Djosm.pref=/PATH/TO/JOSM/PREF            Set the preferences directory
-Djosm.userdata=/PATH/TO/JOSM/USERDATA    Set the user data directory
-Djosm.cache=/PATH/TO/JOSM/CACHE          Set the cache directory
-Djosm.home=/PATH/TO/JOSM/HOMEDIR         Relocate all 3 directories to homedir.

-Djosm.home has lower precedence, i.e. the specific setting overrides this general one.

For some tasks, JOSM has a large appetite for memory. On the one hand, it may be necessary to configure an -Xmx memory size that supports more JOSM plugins and other JOSM editing features. On the other hand, slow systems or those systems with few memory resources, can be stabilized by restricting JOSM memory use. These example Java memory settings provide examples that start with systems that have few memory resources to systems with vast amounts of memory.

-Xmx...m                                  Set maximum Java heap size in megabytes
-Xmx256m
-Xmx1024m
-Xmx2048m

examples

java -jar josm.jar track1.gpx track2.gpx london.osm
java -jar josm.jar https://www.openstreetmap.org/#map=13/43.2/11.1
java -jar josm.jar london.osm --selection=http://www.ostertag.name/osm/OSM_errors_node-duplicate.xml
java -jar josm.jar 43.2,11.1,43.4,11.4
java -jar josm.jar --set=expert=true
java -Djosm.pref=$XDG_CONFIG_HOME -Djosm.userdata=$XDG_DATA_HOME -Djosm.cache=$XDG_CACHE_HOME -jar josm.jar
java -Djosm.home=/home/user/.josm_dev -jar josm.jar
java -Xmx1024m -jar josm.jar

Parameters --download, --downloadgps and --selection are processed in this order.

The option group names used here follow the documentation on Runtime Engine and on Web Start.

See also