JOSM/HOWTO/Run from flash disk with Java

From OpenStreetMap Wiki
Jump to: navigation, search

This HOWTO explains the setup of a portable installation of JOSM with Java for Windows, e.g. for a USB flash disk. This can be useful when you want to run JOSM but Java is not installed on a PC (e.g. at a library). Installation of Java is usually limited to administrator accounts, but Java can run from a flash disk without installing.


You will need:

Assuming you have your flash disk with drive letter F:...


JOSM is actively developed, so it is worth checking that you have the latest version. It can always be found here:

Step #Updating JOSM (optional) below will explain how to automatically download the latest version each time you run JOSM.

For this example, assume you put josm-latest.jar in F:\JOSM

Get Java

If you have run JOSM before on a Windows PC, that machine will already have Java installed.

Otherwise, you will need to install it on a Windows PC where you have admin rights. Get the latest from

Once it's installed on the local machine, you copy the entire contents (subfolders and their files) from C:\Program Files\Java\jre<VERSION>\ to your flash disk.

<VERSION> was "1.6.0_03" in 2007. May be different now.

For the purposes of this HOWTO, put them in F:\Java\ so you have F:\Java\bin and so on.

Create a batch file

By default, JOSM will save your preferences to the local machine, which is not much use for a portable installation. You can easily change that by running it from a batch file:

\Java\bin\java.exe -jar \JOSM\josm-latest.jar 

Save the above in a file, e.g. F:\gojosm.bat

Updating JOSM (optional)

You may wish to automatically download this file each time you run the batch file, using cURL, a small command line program for transferring files.

Unzip the contents of the cURL zip to F:\cURL

Then you can either add the following line to the start of gojosm.bat, or into a separate batchfile (e.g. F:\josm-update.bat)

\cURL\curl -o \JOSM\josm-latest.jar

Note that it is advisable to use a https-secured connection for software downloads. Is cURL capable of this? Then use it.

Note that if you are using JOSM plugins, they may not be compatible with the latest JOSM, so use this with care.

Try it out

That's it! Try running gojosm.bat

See also