Changes between Version 40 and Version 47 of Help/CommandLineOptions
- Timestamp:
- (multiple changes)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Help/CommandLineOptions
v40 v47 1 1 [[TranslatedPages]] 2 [[PageOutline]] 2 [[PageOutline(2)]] 3 3 4 4 = Command Line Options = 5 5 6 6 Four types of command line options affect JOSM: 7 * The [#Programarguments Program arguments⤓] directly control JOSM. They are called ''args'' by Java. 7 * The [#Programarguments Program arguments⤓] directly control JOSM. They are called ''args'' by Java. 8 8 * The [#Javaoptions Java options⤓] affect its environment (JVM) and are sometimes named ''VM arguments''. 9 * Only involved in Web Start are the [#run-options Run-options⤓].10 * Some [#Otheroptions Other options⤓] for diagnostics and launchers.9 * The [#run-options Run-options⤓] are involved in WebStart. Some are for diagnosis and import. 10 * Some [#Otheroptions Other options⤓] for helper programs. 11 11 12 12 {{{ 13 13 #!sh 14 14 # Running a jar 15 java [Java options] -jar josm -tested.jar [Program arguments]15 java [Java options] -jar josm.jar [Program arguments] 16 16 17 17 # Launch a Web Start 18 javaws [ run-options] -J[Java option] josm.jnlp19 }}} 20 21 The [wikitr:/Help/Action/ShowStatusReport Status Report] lists the given Program arguments and Java options in its second section.18 javaws [Run-options] -J[Java option] josm.jnlp 19 }}} 20 21 The [wikitr:/Help/Action/ShowStatusReport Status Report] from the Help menu lists the given Program arguments and Java options. 22 22 Some [#Examples examples⤓] for both of them are shown below. 23 As usual in all four types the arguments are separated by space from each other. 24 25 == JOSM program arguments ==#Programarguments 26 27 The first argument can be a **command** for JOSM to make it work autonomous. 28 If JOSM can't recognize the first argument as command, then `runjosm` is assumed as default. 29 30 The remaining arguments are **options** for JOSM. 31 They can be URLs, filenames, coordinates, simple options and option=value pairs. 32 The complete list of commands and options is shown below: 23 24 **Note:** The term {{{josm.jar}}} is a common abbreviation for the file names ''josm-tested.jar'' and ''josm-latest.jar''. 25 The term ''josm.jnlp'' also stands for ''josm-latest.jnlp''. 26 As usual the command line arguments are separated by space from each other. 27 28 29 == Program arguments for JOSM ==#Programarguments 30 31 The first argument can be a **command** for JOSM to make it work autonomous. 32 The commands are `render`, `project` or `runjosm` as default. 33 34 The remaining arguments are **options** for JOSM. 35 They can be URLs, filenames, coordinates, simple options and option=value pairs. 36 37 The options for runjosm are listed in the following. 38 At the bottom are the options for the commands [#Programargumentsrendering render⤓] and [#Programargumentsproject project⤓]. 33 39 34 40 {{{ … … 40 46 render render data and save the result to an image file 41 47 project convert coordinates from one coordinate reference system to another 48 validate validate data 42 49 43 50 For details on the render and project commands, run them with the --help option. … … 53 60 --downloadgps=<URL> Download the location at the URL (with lat=x&lon=y&zoom=z) as raw GPS 54 61 --selection=<searchstring> Select with the given search 55 --[no-]maximize Launch in maximi sed mode62 --[no-]maximize Launch in maximized mode 56 63 --reset-preferences Reset the preferences to default 57 64 … … 63 70 64 71 --version Displays the JOSM version and exits 72 73 --status-report Show status report with useful information that can be attached to bugs 65 74 66 75 --debug Print debugging messages to console … … 73 82 }}} 74 83 75 The `--download=` part of the download option is optional. 84 The `--download=` part of the download option is optional. 76 85 The arguments `--download`, `--downloadgps` and `--selection` are processed in this order. 77 86 The value `<url-to-xml>` can point to a local file with `file:relative/path/name.xml`. … … 84 93 85 94 {{{ 86 java options: 87 -Djosm.dir.name=JOSM Change the JOSM directory name 88 -Djosm.pref=/PATH/TO/JOSM/PREF Set the preferences directory 89 Default: C:\Users\name\AppData\Roaming\JOSM 90 -Djosm.userdata=/PATH/TO/JOSM/USERDATA Set the user data directory 91 Default: /home/name/.local/share/JOSM 92 -Djosm.cache=/PATH/TO/JOSM/CACHE Set the cache directory 93 Default: <...> 94 -Djosm.home=/PATH/TO/JOSM/HOMEDIR Set the common directory for preferences, 95 user data and ./cache/. Lower precedence. 96 Will get overridden from specific setting. 97 -Xmx...m Set maximum Java heap size in megabytes. 98 May avoid Out-of-Memory errors. 95 Java system properties options: 96 -Djosm.dir.name=JOSM Change the JOSM directory name 97 -Djosm.pref=/PATH/TO/JOSM/PREF Set the preferences directory 98 Default (Linux XDG): /home/name/.config/JOSM 99 Default (Windows): C:\Users\name\AppData\Roaming\JOSM 100 -Djosm.userdata=/PATH/TO/JOSM/USERDATA Set the user data directory 101 Default (Linux XDG): /home/name/.local/share/JOSM 102 Default (Windows): C:\Users\name\AppData\Roaming\JOSM 103 -Djosm.cache=/PATH/TO/JOSM/CACHE Set the cache directory 104 Default (Linux XDG): /home/name/.cache/JOSM 105 Default (Windows): C:\Users\name\AppData\Local\JOSM\cache 106 -Djosm.home=/PATH/TO/JOSM/HOMEDIR Set the common directory for preferences, 107 user data and ./cache/. Lower precedence. 108 Will get overridden from specific setting. 109 -Xmx...m Set maximum Java heap size in megabytes. 110 May avoid Out-of-Memory errors. 99 111 }}} 100 112 … … 102 114 If you set a common directory with `Djosm.home` then JOSM will create the subdirectories ./autosave, ./cache and ./validator. 103 115 If a value has spaces, then enclose it in quotation marks like `"josm dev"`. 116 104 117 When the non-ASCII characters in the command prompt are scrambled, use `-Dfile.encoding=Cp850` to receive text from Java in another [https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html code page]. 105 118 Which [https://msdn.microsoft.com/de-de/library/windows/desktop/dd317756%28v=vs.85%29.aspx code page] is used shows `chcp⏎` in the terminal. 106 For UTF-8 on Windows, invoke `chcp 65001` in the Windows terminal window before launching JOSM using `java -Dfile.encoding=UTF-8 -jar josm-tested.jar` 107 108 [=#Examples **Examples**] 119 For UTF-8 on Windows, invoke `chcp 65001` in the Windows terminal window before launching JOSM using `java -Dfile.encoding=UTF-8 -jar josm.jar` 120 121 JOSMs Debian package `josm-latest` uses `-Djosm.dir.name=JOSM-latest` to offer parallel installations in the XDG base directories. 122 123 [=#Examples **Examples for JOSM runjosm options and Java options**] 109 124 {{{ 110 125 #!sh 111 126 # Load three files 112 java -jar josm -tested.jar track1.gpx BigBen.jpg "london data.osm"127 java -jar josm.jar track1.gpx BigBen.jpg "london data.osm" 113 128 # Download from OSM according to an URL with zoom and coordinates 114 java -jar josm -tested.jar https://www.openstreetmap.org/#map=19/51.51/-0.135129 java -jar josm.jar https://www.openstreetmap.org/#map=18/51.501/-0.124 115 130 # Download a bounding box and select every element matching a string 116 java -jar josm -tested.jar 51.505,-0.14,51.515,-0.13--selection="Piccadilly Circus"131 java -jar josm.jar 51.500,-0.126,51.502,-0.122 --selection="Big Ben" 117 132 # 118 133 # Set directory for JOSM according to a property from the operating system 119 java -Djosm.pref=$XDG_CONFIG_HOME -jar josm -tested.jar134 java -Djosm.pref=$XDG_CONFIG_HOME -jar josm.jar 120 135 # Quotations for a value with space and show JOSMs GUI in English 121 java -Djosm.dir.name="josm dev" -jar josm -latest.jar --language=en122 # Set the common directory in a sub-subdirect roy below the active command prompt123 java -Djosm.home=biketour2017/london -jar josm -tested.jar124 # More memory in the Canadian variant of an English spoken environment125 java -Xmx1024m - Duser.language=en -Duser.country=CA-jar josm-latest.jar136 java -Djosm.dir.name="josm dev" -jar josm.jar --language=en 137 # Set the common directory in a sub-subdirectory below the active command prompt 138 java -Djosm.home=biketour2017/london -jar josm.jar 139 # More memory and without phoning home 140 java -Xmx1024m --set=message.notifier.enabled=false -jar josm.jar 126 141 # 127 # Log debug info and do not get disturbed by JOSM phoning home 128 java -verbose -jar josm-latest.jar --set=message.notifier.enabled=false --debug >WhatsUp.txt 129 }}} 130 131 132 == Java Web Start Run-options ==#run-options 133 The run-options are used by the `javaws` command. They control the Web Start mechanism and can encapsulate Java options. 134 {{{ 142 # Start in an English environment and log debug info plus messages from stderr 143 java -Duser.language=en -jar josm.jar --debug 1>logfile.txt 2>&1 144 }}} 145 146 147 == Run-options for Java Web Start ==#run-options 148 149 The run-options are read by the `javaws` command. They control the Web Start mechanism, can encapsulate Java options and can diagnose Java. 150 {{{ 151 #!sh 152 # Control 135 153 -offline Allows to Web Start JOSM without internet access 136 -J<java option> Supplies the <java option> to the JVM 154 155 # Encapsulate 156 -J<java option> Supplies the <java option> to the JVM 137 157 -J-Xmx1024m Here: Set maximum Java heap size to 1024 megabyte 138 }}} 139 140 The `-J` run-option takes its part behind the J letter and supplies that as Java option. 141 The [wikitr:/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. 142 143 The `javaws` command has some control options on all systems. 144 On [wikitr:/Download#Mswindowswrapper MS Windows] only the Launcher `josm.exe` aka [http://launch4j.sourceforge.net/docs.html#Runtime_options Launch4j] may give some debug info (needs 64-bit Java on 64-bit Windows). 145 {{{ 146 #!sh 147 # Control options: 148 javaws -viewer Shows the Cache Viewer in the Java Control Panel 158 159 # Diagnosis 160 javaws -viewer Shows the Cache Viewer in the Java Control Panel 149 161 # Allows to opens the Java Control Panel from the command line. 150 162 151 163 javaws -clearcache Removes all non-installed applications from the cache 152 # Equal to 'Delete Files and Applications' from the 'Temporary File Settings' invoked 164 # Equal to 'Delete Files and Applications' from the 'Temporary File Settings' invoked 153 165 # by the 'Settings' button in the 'General' tab of the Java Control Panel. 154 166 # javaws -Xclearcache on OpenJDK 155 156 157 # On MS Windows: 167 }}} 168 169 The `-J` run-option takes its part behind the J letter and supplies that as Java option. 170 The [wikitr:/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. 171 172 The `javaws` command has some control options on all systems. 173 174 The `-clearcache` option and clearing the cache via the Java Control Panel will both delete JNLP based icons from the Desktop. The JOSM icon will be gone if it was placed as result of a click in a web browser on a jnlp-file. 175 176 == Other options ==#Otheroptions 177 178 The Launcher `josm.exe` aka [http://launch4j.sourceforge.net/docs.html#Runtime_options Launch4j] (only on [wikitr:/Download#Mswindowswrapper MS Windows]) may give some debug info. 179 {{{ 180 #!sh 158 181 josm.exe --j4l-debug Tries to write a launch4j.log to current directory 159 182 josm.exe --j4l-dont-wait Ends the wrapper after invoking JOSM. 160 183 }}} 161 The `-clearcache` option and clearing the cache via the Java Control Panel will both delete JNLP based icons from the Desktop. The JOSM icon will be gone if it was placed as result of a click in a web browser on a jnlp-file. 162 163 == JOSM rendering command line interface == 184 185 == Command line for Render and Project == 186 187 === JOSM rendering Program arguments ===#Programargumentsrendering 164 188 165 189 {{{ … … 213 237 }}} 214 238 215 == JOSM projection command line interface ==239 === JOSM projection Program arguments ===#Programargumentsprojection 216 240 217 241 {{{ … … 246 270 }}} 247 271 272 248 273 == See also == 249 274 * [wikitr:/Download#Troubleshooting Troubleshooting Java]
