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.
In this post, I will cover how to get it installed on Debian, how to properly configure it for mapping on OSM, and which plugins to install and use.
Installing JOSM on Debian
JOSM is available in the Debian official repository, so to install it, you just need to open a terminal and run the following command:
su -c 'apt-get install josm'
Solving JOSM Outdated Version on Debian
Installing JOSM from the official Debian repositories resolves the dependency issue you would encounter when using the most up-to-date version from the official .jar build.
To run the latest stable version, you need to download it from the official JOSM website as a JAR file. However, before doing that, you need to run the version installed from the Debian repository at least once.
josm
This will create the following directory structure:
~/.config/JOSM
~/.cache/JOSM
~/.local/share/JOSM
Under ~/.cache/JOSM/, a directory named jar will be created:
mkdir -p ~/.cache/JOSM/jar
Now, navigate to that directory:
cd ~/.cache/JOSM/jar
Next, download the latest version of the JOSM editor using wget:
wget -N -t 0 -c https://josm.openstreetmap.de/josm-tested.jar
To run the newly downloaded version, use the following command:
java -jar ~/.cache/JOSM/jar/josm-tested.jar
Script Launcher
To launch the JAR file easily, you can create a script. First, create an executable file:
touch ~/.local/bin/tested-josm.sh
Then, add the following content to the script:
#! /bin/bash
java -jar ~/.cache/JOSM/jar/josm-tested.jar
Adding a Launcher
To make this process even easier, let's create a launcher for the manually downloaded JOSM JAR file and the previously created script.
Create a new desktop entry file:
touch ~/.local/share/applications/org.openstreetmap.josm.desktop
Then, add the following content to the file:
[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. By clicking on it, you will launch the most up-to-date version of JOSM on Debian.