OpenStreetMap logo OpenStreetMap

How to run JOSM on Chromebook

Posted by omgitsgela on 26 June 2019 in English. Last updated on 27 June 2019.

Did you just get a Chromebook, and excited to get mapping with it? You can run JOSM on Chromebook with a little bit of effort. This guide was written for ChromeOS 74.0.3729.159 and up and relies on the Debian Stretch 9 emulator Crostini. As you’re entering these commands, you can copy and paste them from the website to the Debian terminal by using a right click (or Alt + Click if you don’t have an external mouse connected)

Step 1 - Enable Linux Apps

Open the Settings app, and search for Linux. Click “Turn On” to enable Linux support. On the popup installer, click Install. Sit back and wait. When the installation is complete, a Debian Linux shell terminal will automatically open.

Step 2 - Add the JOSM repository

This command adds the JOSM repository to the sources list. echo deb https://josm.openstreetmap.de/apt alldist universe | sudo tee -a /etc/apt/sources.list

Download and register the OpenStreetMap public key. wget -q https://josm.openstreetmap.de/josm-apt.key -O- | sudo apt-key add -

Step 3 - Update the APT repositories and install

This will query updates to all packages, and install josm afterwards. This will take quite some time. Go grab a coffee. sudo apt update ; sudo apt install josm

Step 4 - Run JOSM

Open up JOSM within the App Folder “Linux Apps” from the launcher. It’s possible that JOSM could have too small a font to read on your screen. The fix is to install Java 11 and use UIScaling to render the applet with a larger font. If you wish to fix this and give JOSM a larger font, follow the next steps:

Optional Step 5 - Enable Backports

Debian Stretch doesn’t come with Java JDK 11 by default, but we can enable it by adding the backports software repository.

echo deb http://deb.debian.org/debian stretch-backports main sudo tee -a /etc/apt/sources.list

Optional Step 6 - Install JDK 11

UIScaling is only compatible with JDK 11, not the default JDK 8. We need to upgrade. Enter this command: sudo apt install openjdk-11-jdk

Optional Step 7 - Reinstall JOSM so it sees JDK 11

We want to make sure JOSM is configuring itself to use JDK 11 instead of 8. Reinstall it.

sudo apt remove josm ; sudo apt install josm

Optional Step 8 - Edit the Launcher Tile

We need to inject the UI Scaling parameters into the launcher tile. The best way to do this is with the command line text editor nano, but you can use whichever editor you are most familiar with. sudo apt install nano

Once nano is installed, use the command sudo nano /usr/bin/josm Navigate to line 27, and you should see this option: JAVA_OPTS=”-Djosm.restart=true -Djava.net.useSystemProxies=true $JAVA_OPTS”

Edit this line to state the following: JAVA_OPTS=”-Dsun.java2d.uiScale=2.0 -Djosm.restart=true -Djava.net.useSystemProxies=true $JAVA_OPTS”

Mandatory Step 9 - Start mapping!

Some caveats:

  1. uiScale values between 1.0 and 2.0 don’t seem to make a difference. For some people, a 2.0 scaling factor might actually be too big. I don’t know why we are unable to pick a smaller value. Perhaps someone else has some feedback on how to choose a scaling value between the two.
  2. JOSM will NOT pick up remote commands from task managers across the Debian shell environment. If you need to import or do task manager roles, I’d recommend using GPX file downloads, or edit with iD and copy the URL of the ID editor into JOSM’s downloader to get the boundary.
  3. I am not a linux expert. These commands might break something. Luckily, if you break things, you can just turn off and back on the Linux environment in ChromeOS settings and start from scratch. I’d recommend backing up the linux environment before proceeding if you already have it active for your Chromebook. Some of these commands might have better ways to do the same thing. If you’re a Linux wizard, feel free to comment about better ways to do these steps.

Discussion

Comment from SomeoneElse on 27 June 2019 at 15:32

Thanks for this. It’s always good to have an alternative to doing things via a Linux GUI and “crouton” on a Chromebook. Chromebooks are surprisingly capable for the money, and if you don’t want to use the Google stuff, you don’t have to. You’ve also got the option of keeping all the data (or software) you care about on an external USB stick and just putting that in your pocket when you’re worried that the PC might get stolen.

Best Regards,

Andy

(one minor note - an extra space has crept into “/etc/apt/sourc es.list”).

Comment from DarkDays on 21 October 2021 at 17:42

Someone just found this, and asked me for help with it. This is a bit outdated and doesn’t work with Debian buster.

The quickest solution was just to use the one in the Debian repos. It might be a bit outdated, but it works.

Comment from vorpalblade on 31 May 2022 at 13:01

From a related diary post, https://www.openstreetmap.org/user/R66_Mapper/diary/398993:

  1. Set up flatpak (see https://flatpak.org/setup/Chrome%20OS )
  2. Install JOSM from the flathub repository (see https://flathub.org/apps/details/org.openstreetmap.josm )

I am hoping that this becomes easier in the future (see https://chromeos.dev/en/posts/bringing-steam-to-chromeos ), but time will tell.

Comment from George Karidis on 6 February 2023 at 16:56

when I tried sudo apt update it droped me this: E: Malformed entry 1 in list file /etc/apt/sources.list.d/josm.list (Component) E: The list of sources could not be read.

Log in to leave a comment