Search:
Login
Preferences
Help/Guide
About Trac
Register
Forgot your password?
Wiki
Timeline
Changelog
Browse Source
View Tickets
New Ticket
Roadmap
Builds
Sonar
Search
Context Navigation
+0
Start Page
Index
History
Editing Help/CommandLineOptions
Adjust edit area height:
8
12
16
20
24
28
32
36
40
Edit side-by-side
[[TranslatedPages]] = Command Line Options = {{{#!comment No table of content. }}} JOSM is affected by three groups of command line options. The [#Programarguments Program arguments] are most important and than the [#Javaoptions Java options]. Only involved in Web Start are the [#run-options run-options]. See [#Examples Examples] {{{ #!sh # Running a jar java [Java options] -jar josm-tested.jar [Program arguments] # Launch a Web Start javaws [run-options] -J[Java option] josm.jnlp }}} === Program arguments ===#Programarguments Also called ''Post jar arguments'' here or ''args'' by Oracle. The first argument is seen as ''command'' by JOSM. The possible commands are `runjosm` for normal launch (default), `render` for generating an image file and `project` converting coordinates. If JOSM can't recognize a command the default is assumed. The following arguments are ''options'' for JOSM. They are separated by spaces. They can be URLs, filenames, coordinates, simple options and option=argument pairs. The complete list of commands and options is shown below: {{{ usage: java <java options> -jar josm.jar [<command>] <options> commands: runjosm launch JOSM (default, performed when no command is specified) render render data and save the result to an image file project convert coordinates from one coordinate reference system to another For details on the render and project commands, run them with the --help option. The remainder of this help page documents the runjosm command. options: --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 URL which has coordinates like lat=x&lon=y&zoom=z [--download=]<filename> Open a file (same as Menu/File/Open) --downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw GPS --downloadgps=<URL> Download the location 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> Import preferences from 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 listed resources }}} The `--download=` part of the download option is optional. The arguments `--download`, `--downloadgps` and `--selection` are processed in this order. The value `<url-to-xml>` can point to a local file with `file:relative/path/name.xml`. The items in the `--offline` value are separated by comma. === Java options ===#Javaoptions The Java options are also called ''JOSM JVM options'' here or ''VM arguments'' in the [wiki:/Help/Action/ShowStatusReport Status Report]. In that report you can see them and also the Program Arguments. They control the Java virtual machine [https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html (JVM)] and can set [https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html properties] inside it. JOSM reads some of them, for example `josm.home` and `user.language`. {{{ java options: -Djosm.dir.name=JOSM Change the JOSM directory name -Djosm.pref=/PATH/TO/JOSM/PREF Set the preferences directory Default: C:\Users\name\AppData\Roaming\JOSM -Djosm.userdata=/PATH/TO/JOSM/USERDATA Set the user data directory Default: /home/name/.local/share/JOSM -Djosm.cache=/PATH/TO/JOSM/CACHE Set the cache directory Default: <...> -Djosm.home=/PATH/TO/JOSM/HOMEDIR Set the common directory for preferences, user data and ./cache/. Lower precedence. Will get overridden from specific setting. -Xmx...m Set maximum Java heap size in megabytes. May avoid Out-of-Memory errors. }}} The `-Xmx...m` option may be useful when [wiki:/Download#Outofmemory Out of Memory] errors arise. If you set a common directory with `Djosm.home` then JOSM will create the subdirectories ''./autosave'', ''./cache'' and ''./validator''. If a value has spaces, then enclose it in quotation marks like `"josm dev"`. === run-options === The run-options follow the `javaws` command. They control the Web Start mechanism and the environment for the JVM. {{{ -offline Allows to Web Start JOSM without internet access -J<java option> Supplies the <java option> to the JVM -J-Xmx1024m Here: Set maximum Java heap size to 1024 megabyte }}} The `-J` run-option takes its part behind the J letter and supplies that as Java option. The [wiki:/Help/jnlpOptions jnlp-File] used by [https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javaws.html Web Start] offers a second way to [https://docs.oracle.com/javase/8/docs/technotes/guides/javaws/developersguide/syntax.html set options] for JRE and for the JOSM program directly. === Examples === {{{ #!sh # Load three files java -jar josm.jar track1.gpx BigBen.jpg "london data.osm" # Download from OSM according to an URL with zoom and coordinates java -jar josm.jar https://www.openstreetmap.org/#map=19/51.51/-0.135 # Download a bounding box and select every element matching a string java -jar josm.jar 51.505,-0.14,51.515,-0.13 --selection="Piccadilly Circus" # # Set directory for JOSM according to a property from the operating system java -Djosm.pref=$XDG_CONFIG_HOME jar josm.jar # Quotations for a value with space java -Djosm.dir.name="josm dev" -jar josm.jar # Set the common directory in a sub-subdirectroy below the active command prompt java -Djosm.home=biketour2017/london -jar josm.jar # More memory in a French spoken environment java -Xmx1024m -Duser.language=fr -jar josm.jar # # Log everything in English java -verbose -jar josm-latest.jar --language=en --debug >WhatsUp.txt }}} === See also === * [wiki:Download#Troubleshooting Troubleshooting Java] * [wiki:InstallNotes Installation notes] * [wiki:Help/Preferences Preferences] - overview page about all "preferences"
Note:
See
WikiFormatting
and
TracWiki
for help on editing wiki content.
Change information
Your email or username:
E-mail address and name can be saved in the
Preferences
Comment about this change (optional):
Note:
See
TracWiki
for help on using the wiki.