特殊:Badtitle/NS100:JOSM

来自Ubuntu中文
Wikibot留言 | 贡献2008年12月16日 (二) 19:09的版本
跳到导航跳到搜索

{{#ifexist: :JOSM/zh | | {{#ifexist: JOSM/zh | | {{#ifeq: {{#titleparts:JOSM|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:JOSM|1|-1|}} | zh | | }}

JOSM is the Java Open Street Map editor for use with the Open Street Map project. This page is solely for Ubuntu related information and installation instructions. For a more in-depth guide and some tutorial material, please visit the OSM wiki page for JOSM.

Installation on Ubuntu

The Open Street Map project has been around for several years now and the best currently developed editor (JOSM) has only recently been packaged for Debian and Ubuntu. While the MOTU maintained package should be your first choice, you can still use this installation guide to use the project's main development jar file directly.

Installing JOSM

JOSM is available from the Universe repositories for the first time in Ubuntu 8.04. So you can install the package josm very quickly and easily through your favourite package manager. The downside of this is that JOSM is very much a fast moving target and has changed rapidly of the last few months. To take advantage of the bug fixes and new features you may want to download the very latest version. See the following section to install manually.

Manually Installing JOSM

If have a version of Ubuntu older than 8.04 or just want to install JOSM manually then follow these instruction.

Installing Java

As the name implies JOSM requires a Java runtime environment to work. Ubuntu 8.04 has a version of GNU's GCJ that is compatible with JOSM. Unfortunately previous version of Ubuntu will require you to have Sun's JRE of at least v1.5, which is simple to install through Synaptic. Please note this requires the universe repository. /!\ Ensure the Java path is set to the latest Java version. See the Java wiki page for more details.

Downloading JOSM

Click here to download the latest version of JOSM. You may also want to take a look at the recent changelog. Now you can start JOSM by simply running the following command from a terminal using the path to the JOSM jar file.

java -jar ~/Desktop/josm-latest.jar

Note that JOSM can use a lot of memory, so it may pay to run something like java -Xmx512M -jar ...

Desktop Integration

For better integration into the Ubuntu desktop use the following steps (please note that sudo access will be required):

  • Move the jar file to the /usr/share/java folder.
sudo mv ./Desktop/josm-latest.jar /usr/share/java/ 
  • Download the menu icon, rename it to josm.png and place it in the /usr/share/pixmaps/ directory.
 
sudo mv ./Desktop/logo.png /usr/share/pixmaps/josm.png 
  • Use the following code to create a josm.desktop file place it in the /usr/share/applications/ directory.
[Desktop Entry]
Encoding=UTF-8
Name=JOSM
Comment=Import GPX files and upload Open Street Map data
Exec=java -jar /usr/share/java/josm-latest.jar
Icon=josm.png
Terminal=false
Type=Application
StartupNotify=true
Categories=Application;GTK;Java;Utility;Viewer;
MimeType=application/x-GPS-Exchange-Format

Now you should have an entry for JOSM in your desktop menu, the exact location will depend on which desktop you are using.

Updating JOSM

You only have to download a newer josm-latest.jar file to update JOSM to the latest daily build. I would recommend that you do this on a monthly basis if you want to keep up with bug fixes and new features. Sometimes there will be changes to the default startup settings of JOSM. You will not see these changes until you update your ~/.josm/preferences file. The quickest way is generate a new one by simply renaming/deleting the file and restarting JOSM. Please bear in mind that if you do this you will lose your current settings such as the upload logon information, if you chose to save it earlier.

Troubleshooting

xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
Aborted (core dumped)

If you receive the error this error, try running the following command.

export LIBXCB_ALLOW_SLOPPY_LOCK=true

This page was originally based on this Ubuntuforums.org thread.