JOSM/Linux

From OpenStreetMap Wiki
Jump to navigation Jump to search
Linux mascot “Tux”

This page provides help for JOSM on Linux systems.

Installing JOSM

The following distributions have JOSM available in their package libraries, however the maintenance of these packages may be some way behind the recent JOSM developments and bug fixes.

In general, JOSM simply requires a single jar file, so downloading and starting a recent version of this jar file can be the best way to work with a reasonably up-to-date version of JOSM. See the general JOSM/Installation page for this.

Some of the following instructions use wget to download. In case the wget complains about a certificate error you may want to install the required root CA certificates to your system, or wget's --no-check-certificate switch or use the unsecured http URL.

Arch Linux

You can install the JOSM package from the official repositories.

pacman -S josm

Alternatively, these packages are also available in the AUR:

Debian

This is the recommended way to install on all Debian versions. Add the apt repository from openstreetmap.de:

  1. Use the following one-liner in a terminal to create a new repository:
    echo deb https://josm.openstreetmap.de/apt alldist universe | sudo tee /etc/apt/sources.list.d/josm.list > /dev/null
    
  2. Next, it is necessary to download and register the openstreetmap.de public key. That can also be done in a single line:
    wget -q https://josm.openstreetmap.de/josm-apt.key -O- | sudo apt-key add -
    
  3. The final item is to refresh the sources and install. Run
    sudo apt-get update ; sudo apt-get install josm
    

Troubleshooting

Sudo-error

See the debian documentation about sudo if this command fails.

Apt-https-error

You may suffer an extra wrinkle at this point, not mentioned on the Download page:

:~$ sudo apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

It is a simple matter of installing apt-transport-https first.

JOSM-Plugins:

The simple instruction for all distributions is: do not install. Install instead from within JOSM (that was easy).

Java

JOSM requires minimum Java-8, if this is not available on your distribution, please see elsewhere how to install a newer java-version.

Ubuntu

On Ubuntu 16.04 and above we recommend following the Debian install above as it ensures you will get updates. Alternatively, the manual installation or the JOSM packages. The version from the official Ubuntu repositories is often outdated and is not recommended.

On Ubuntu 20.10 and later, due to deprecation of apt-key, replace the instructions above by:

echo "deb [signed-by=/usr/share/keyrings/josm-archive-keyring.gpg] https://josm.openstreetmap.de/apt alldist universe" | sudo tee /etc/apt/sources.list.d/josm.list > /dev/null
wget -O- https://josm.openstreetmap.de/josm-apt.key | gpg --dearmor | sudo tee /usr/share/keyrings/josm-archive-keyring.gpg > /dev/null
sudo apt-get update ; sudo apt-get install josm

FreeBSD

On FreeBSD JOSM is available at ports/astro/josm.

Gentoo

See JOSM/Gentoo

Linux Mint

You can use the Ubuntu package in Linux Mint:

#Add the key
wget -q https://josm.openstreetmap.de/josm-apt.key -O- | sudo apt-key add -
#Add the repository
echo "deb https://josm.openstreetmap.de/apt `awk -F= '/^UBUNTU_CODENAME=/ { print $2 }' /etc/os-release` universe" | sudo tee -a /etc/apt/sources.list

openSUSE

OpenSUSE Build Service has regularly updated builds at Applications:Geo. Install via YaST, or with `zypper in josm`.

Start JOSM

  • See JOSM/Installation#Start JOSM.
  • If you installed JOSM via a package (e.g. from your distribution), you may be able to simply use a simpler josm command.

To automate updating and starting you can use

  • an update and startup script that backs up a number of old versions if the current one doesn't work as desired
  • or you can use the following simple script to use always the latest JOSM version (note that it contains some stuff which you may not need – proxy — or which you may not have – kdialog):
#!/bin/sh
GPSDIR=/home/sven/Desktop/gps
PROXY=www-proxy
export JAVA_HOME=/usr/local/java/jdk1.6.0_04/
DCOPREF=`kdialog --title "Hole JOSM"  --progressbar "Hole JosmLatest" 100`
cd $GPSDIR
wget -N https://josm.openstreetmap.de/download/josm-latest.jar
dcop "$DCOPREF"  close
$JAVA_HOME/bin/java -Xmx1024M -DproxyHost=$PROXY -DproxyPort=8080 -jar josm-latest.jar

Font size too small on high-DPI display

On a high resolution screen, JOSM might display with very small fonts in its user interface. You can work around this by setting the environment variable GDK_SCALE. In a terminal, start JOSM like this:

GDK_SCALE=2 josm

As of Debian version 17428, you can make the above setting stick in the app menu until the next update with:

sudo sed -i 's@Exec=.*@Exec=bash -c \"GDK_SCALE=2 /usr/bin/josm %U\"@' /usr/share/applications/org.openstreetmap.josm.desktop && sleep 15 && sudo update-desktop-database