19 | | Java Virtual Machine options:: |
20 | | Control the handler of virtual machine, for example `--Xmx2048m`. The `--jar jarfile` part is a java option, too. |
21 | | Control the environment inside the virtual machine for JOSM, for example `-Djosm.home=/home/user/.josm_dev` |
22 | | WebStart run-options:: |
23 | | Control the startup of the handler, for example `-J--Xmx2048m` to hand over the string 'Xmx2048m' to the JVM |
24 | | `--offline` |
| 20 | Also called ''Post jar arguments'' here or ''args'' by Oracle. |
| 21 | |
| 22 | 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. |
| 23 | |
| 24 | 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: |
| 25 | |
| 26 | {{{ |
| 27 | usage: |
| 28 | java <java options> -jar josm.jar [<command>] <options> |
| 29 | |
| 30 | commands: |
| 31 | runjosm launch JOSM (default, performed when no command is specified) |
| 32 | render render data and save the result to an image file |
| 33 | project convert coordinates from one coordinate reference system to another |
| 34 | |
| 35 | For details on the render and project commands, run them with the --help option. |
| 36 | The remainder of this help page documents the runjosm command. |
| 37 | |
| 38 | options: |
| 39 | --help|-h Show this help |
| 40 | --geometry=widthxheight(+|-)x(+|-)y Standard unix geometry argument |
| 41 | [--download=]minlat,minlon,maxlat,maxlon Download the bounding box |
| 42 | [--download=]<URL> Download the location URL which has |
| 43 | coordinates like lat=x&lon=y&zoom=z |
| 44 | [--download=]<filename> Open a file (same as Menu/File/Open) |
| 45 | --downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw GPS |
| 46 | --downloadgps=<URL> Download the location as raw GPS |
| 47 | --selection=<searchstring> Select with the given search |
| 48 | --[no-]maximize Launch in maximized mode |
| 49 | --reset-preferences Reset the preferences to default |
| 50 | --load-preferences=<url-to-xml> Import preferences from XML file |
| 51 | --set=<key>=<value> Set preference key to value |
| 52 | --language=<language> Set the language |
| 53 | --version Displays the JOSM version and exits |
| 54 | --debug Print debugging messages to console |
| 55 | --skip-plugins Skip loading plugins |
| 56 | --offline=[osm_api,][josm_website,][all] Disable access to the listed resources |
| 57 | }}} |
| 58 | |
| 59 | The `--download=` part of the download option is optional. |
| 60 | The arguments `--download`, `--downloadgps` and `--selection` are processed in this order. |
| 61 | The value `<url-to-xml>` can point to a local file with `file:relative/path/name.xml`. |
| 62 | The items in the `--offline` value are separated by comma. |
37 | | --help|-h Show this help |
38 | | --geometry=widthxheight(+|-)x(+|-)y Standard unix geometry argument |
39 | | [--download=]minlat,minlon,maxlat,maxlon Download the bounding box |
40 | | [--download=]<URL> Download the location at the URL (with lat=x&lon=y&zoom=z) |
41 | | [--download=]<filename> Open a file (any file type that can be opened with File/Open) |
42 | | --downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw GPS |
43 | | --downloadgps=<URL> Download the location at the URL (with lat=x&lon=y&zoom=z) as raw GPS |
44 | | --selection=<searchstring> Select with the given search |
45 | | |
46 | | --[no-]maximize Launch in maximized mode |
47 | | --reset-preferences Reset the preferences to default |
48 | | --load-preferences=<url-to-xml> Changes preferences according to the XML file |
49 | | --set=<key>=<value> Set preference key to value |
50 | | --language=<language> Set the language |
51 | | --version Displays the JOSM version and exits |
52 | | --debug Print debugging messages to console |
53 | | --skip-plugins Skip loading plugins |
54 | | --offline=<osm_api|josm_website|all> Disable access to the given resource(s), separated by comma |
| 69 | java options: |
| 70 | -Djosm.dir.name=JOSM Change the JOSM directory name |
| 71 | -Djosm.pref=/PATH/TO/JOSM/PREF Set the preferences directory |
| 72 | Default: C:\Users\name\AppData\Roaming\JOSM |
| 73 | -Djosm.userdata=/PATH/TO/JOSM/USERDATA Set the user data directory |
| 74 | Default: /home/name/.local/share/JOSM |
| 75 | -Djosm.cache=/PATH/TO/JOSM/CACHE Set the cache directory |
| 76 | Default: <...> |
| 77 | -Djosm.home=/PATH/TO/JOSM/HOMEDIR Set the common directory for preferences, |
| 78 | user data and ./cache/. Lower precedence. |
| 79 | Will get overridden from specific setting. |
| 80 | -Xmx...m Set maximum Java heap size in megabytes. |
| 81 | May avoid Out-of-Memory errors. |
66 | | -Djosm.pref=/PATH/TO/JOSM/PREF Set the preferences directory |
67 | | -Djosm.userdata=/PATH/TO/JOSM/USERDATA Set the user data directory |
68 | | -Djosm.cache=/PATH/TO/JOSM/CACHE Set the cache directory |
69 | | -Djosm.home=/PATH/TO/JOSM/HOMEDIR Relocate all 3 directories to homedir. |
70 | | }}} |
71 | | `-Djosm.home` has lower precedence, i.e. the specific setting overrides this general one. |
72 | | |
73 | | 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. |
74 | | {{{ |
75 | | -Xmx...m Set maximum Java heap size in megabytes |
76 | | -Xmx256m |
77 | | -Xmx1024m |
78 | | -Xmx2048m |
| 91 | -offline Allows to Web Start JOSM without internet access |
| 92 | -J<java option> Supplies the <java option> to the JVM |
| 93 | -J-Xmx1024m Here: Set maximum Java heap size to 1024 megabyte |
84 | | java -jar josm.jar track1.gpx track2.gpx london.osm |
85 | | java -jar josm.jar https://www.openstreetmap.org/#map=13/43.2/11.1 |
86 | | java -jar josm.jar london.osm --selection=http://www.ostertag.name/osm/OSM_errors_node-duplicate.xml |
87 | | java -jar josm.jar 43.2,11.1,43.4,11.4 |
88 | | java -jar josm.jar --set=expert=true |
89 | | java -Djosm.pref=$XDG_CONFIG_HOME -Djosm.userdata=$XDG_DATA_HOME -Djosm.cache=$XDG_CACHE_HOME -jar josm.jar |
90 | | java -Djosm.home=/home/user/.josm_dev -jar josm.jar |
91 | | java -Xmx1024m -jar josm.jar |
| 103 | # Load three files |
| 104 | java -jar josm.jar track1.gpx BigBen.jpg "london data.osm" |
| 105 | # Download from OSM according to an URL with zoom and coordinates |
| 106 | java -jar josm.jar https://www.openstreetmap.org/#map=19/51.51/-0.135 |
| 107 | # Download a bounding box and select every element matching a string |
| 108 | java -jar josm.jar 51.505,-0.14,51.515,-0.13 --selection="Piccadilly Circus" |
| 109 | # |
| 110 | # Set directory for JOSM according to a property from the operating system |
| 111 | java -Djosm.pref=$XDG_CONFIG_HOME jar josm.jar |
| 112 | # Quotations for a value with space |
| 113 | java -Djosm.dir.name="josm dev" -jar josm.jar |
| 114 | # Set the common directory in a sub-subdirectroy below the active command prompt |
| 115 | java -Djosm.home=biketour2017/london -jar josm.jar |
| 116 | # More memory in a French spoken environment |
| 117 | java -Xmx1024m -Duser.language=fr -jar josm.jar |
| 118 | # |
| 119 | # Log everything in English |
| 120 | java -verbose -jar josm-latest.jar --language=en --debug >WhatsUp.txt |