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!
- 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.
- 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.
- 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.