JOSM is in my opinion the best editor for OpenStreetMap I have ever used and it is also the best Java software I have ever used too.
In this post, I will cover how to get it installed on Debian and how to properly configure it for mapping on OSM and what plugins to install and use.
Installing JOSM on Debian
JOSM is available on the Debian official repository, so for its installation, you just need to open a terminal and type the next command:
su -c 'apt-get install josm'
Solving JOSM outdated version on Debian
Installing JOSM from the official Debian repositories solves the dependency issue we would find if we ran the most up-to-date version from the official .jar build.
To run the most up-to-date stable version we need to download it from the official JOSM website as a JAR file, but first, we need to run at least once the version is installed from the Debian repository.
josm
This is going to create the next directory structure associated with it:
~/.config/JOSM
~/.cache/JOSM
~/.local/share/JOSM
Under ~/.cache/JOSM/ will create a directory named jar:
mkdir -p ~/.cache/JOSM/jar
Now let us move to that directory:
cd ~/.cache/JOSM/jar
Now let's download the most up to date version of the JOSM editor using wget:
wget -N -t 0 -c https://josm.openstreetmap.de/josm-tested.jar
Now, to run the new version up to date version, we download:
java -jar ~/.cache/JOSM/jar/josm-tested.jar
Script launcher
To launch the JAR file, we can add the last command to a file with executable permissions:
touch ~/.local/bin/tested-josm.sh
Then add the following to it:
#! /bin/bash
java -jar ~/.cache/JOSM/jar/josm-tested.jar
Adding a launcher
To make this easier, let's create a launcher for the manually downloaded JOSM JAR file and previously created script:
touch ~/.local/share/applications/org.openstreetmap.josm.desktop
And add the following:
[Desktop Entry]
Type=Application
Version=1.0
Name=JOSM Tested
GenericName=Java OpenStreetMap Editor
Comment=Extensible off-line editor for OpenStreetMap (OSM)
Icon=org.openstreetmap.josm
Exec=/home/pionen/.local/bin/tested-josm.sh
Terminal=false
MimeType=application/x-osm+xml;application/x-gpx+xml;application/geo+json;application/x-josm-session+xml;application/x-josm-session+zip;x-scheme-handler/geo;
StartupNotify=true
Categories=Education;Geoscience;Maps;
StartupWMClass=org-openstreetmap-josm-MainApplication
Keywords=OpenStreetMap;OSM;
The next time you restart your computer, you will find the new launcher, and by just clicking on it, you will start the most up-to-date version of JOSM on Debian.