| 1 | # <img height="40" width="40" src="resources/images/logo.svg" title="JOSM logo"/> JOSM - Java OpenStreetMap Editor |
| 2 | |
| 3 | JOSM is an extensible editor for [OpenStreetMap](https://www.openstreetmap.org/) (OSM) for Java 8+. It supports loading |
| 4 | GPX tracks, background imagery, and OSM data from local sources as well as from online sources and allows to edit the |
| 5 | OSM data (nodes, ways, and relations) and their metadata tags. |
| 6 | |
| 7 | |
| 8 | ## I. Install & Launch |
| 9 | |
| 10 | To run JOSM, you need: |
| 11 | |
| 12 | * Java Runtime Environment (JRE) 8, or later |
| 13 | * The JOSM .jar file, e.g. `josm-tested.jar` or `josm-latest.jar` |
| 14 | |
| 15 | |
| 16 | ### How to get Java Runtime Environment |
| 17 | |
| 18 | You need JRE Version 8, or later. |
| 19 | |
| 20 | - **Microsoft Windows** and **Apple macOS** users should visit one of: |
| 21 | - https://www.azul.com/downloads/?package=jdk#download-openjdk |
| 22 | - https://bell-sw.com/pages/downloads/#mn |
| 23 | |
| 24 | and download the latest Java executable for their system. |
| 25 | - **Linux** users should visit http://www.oracle.com/technetwork/java/index.html There is a Linux binary installer, |
| 26 | which you must execute from a console, or use the mechanism of your distribution's packaging system. |
| 27 | |
| 28 | |
| 29 | ### How to launch |
| 30 | |
| 31 | - **Microsoft Windows** users launch by double-clicking on the .jar file. |
| 32 | If this does not work, open a command shell and type |
| 33 | ```shell |
| 34 | java -jar josm-latest.jar |
| 35 | ``` |
| 36 | in the directory that holds the file. (Please replace josm-latest.jar with the name of your .jar file, |
| 37 | if you aren't using the latest version.) |
| 38 | |
| 39 | - Under **Linux**, open a shell, go to the file directory and type |
| 40 | ```shell |
| 41 | java -jar josm-latest.jar |
| 42 | ``` |
| 43 | to launch. If this does not work, try to set your `JAVA_HOME` variable to the java executable location (the |
| 44 | root location, not the bin). |
| 45 | |
| 46 | - **macOS** users just click on the .jar file icon. |
| 47 | |
| 48 | |
| 49 | ## II. Development |
| 50 | |
| 51 | ### How to get the source code |
| 52 | |
| 53 | Download it directly from the subversion at |
| 54 | https://josm.openstreetmap.de/svn/trunk. To use the command line subversion |
| 55 | client, type |
| 56 | ```shell |
| 57 | svn co https://josm.openstreetmap.de/svn/trunk josm |
| 58 | ``` |
| 59 | |
| 60 | |
| 61 | ### Files & directories |
| 62 | |
| 63 | This is an overview of the files and directories in the JOSM code repository: |
| 64 | ``` |
| 65 | - build.xml ant build file (standard way to create a JOSM binary) |
| 66 | - CONTRIBUTION list of major code contributors |
| 67 | - gpl-2.0.txt, gpl-3.0.txt full text of the GNU General Public License |
| 68 | - LICENSE the JOSM license terms |
| 69 | - native/ OS-specific files |
| 70 | - linux/ files useful for Linux distributions, including Appdata files, .desktop |
| 71 | files, Debian/Ubuntu scripts, man pages, icons, etc. |
| 72 | - macosx/ files needed to create the MacOS package |
| 73 | - windows/ files needed to create the Windows installer |
| 74 | - josm.jnlp Java Web Start launcher file (used on the website for the tested version) |
| 75 | - josm-latest.jnlp Java Web Start launcher file (used on the website for the latest version) |
| 76 | - nodist/ files not included in JOSM binary |
| 77 | - data/ data files that are useful for development, but not distributed |
| 78 | - exif-direction-example.jpg |
| 79 | sample image, that contains direction information in the EXIF header |
| 80 | (keys: Exif.GPSInfo.GPSImgDirectionRef, Exif.GPSInfo.GPSImgDirection) |
| 81 | - filterTests.osm used for unit testing of the filter feature |
| 82 | (see test/unit/org/openstreetmap/josm/data/osm/FilterTest.java) |
| 83 | - Join_Areas_Tests.osm some examples to test the 'join areas' feature |
| 84 | - *.* various other data files used for unit testing and as reference file |
| 85 | - projection/ projection files |
| 86 | - *.gsb NTv2 grid files for projection support, downloaded by the |
| 87 | client on demand (see CONTRIBUTION) |
| 88 | - CHENyx06-Distribution.pdf |
| 89 | archive of terms of use for the CHENyx06.gsb file |
| 90 | - epsg EPSG data file, taken from the proj.4 project |
| 91 | (see https://github.com/OSGeo/proj.4/blob/master/nad/epsg) |
| 92 | - esri ESRI data file, taken from the proj.4 project |
| 93 | (see https://github.com/OSGeo/proj.4/blob/master/nad/esri) |
| 94 | - josm-epsg customizations to the epsg file, used together with the epsg file |
| 95 | to generate data/projection/custom-epsg |
| 96 | |
| 97 | - projection-reference-data.csv |
| 98 | reference data for projection tests |
| 99 | (see test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java) |
| 100 | - projection-regression-test-data.csv |
| 101 | regression data for projection tests |
| 102 | (see test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java) |
| 103 | - trans/*.lang translation data for files that are not distributed, but used |
| 104 | by the server for localization of the services; |
| 105 | currently contains plugin descriptions in order to include translations |
| 106 | in the downloaded plugin list |
| 107 | - images/ images, which are not for distribution, but may be useful later (e.g. high |
| 108 | resolution and vector versions) |
| 109 | - styles/ files needed for map style maintenance |
| 110 | - potlatch2/README infos on how to update the Potlatch 2 style from upstream sources |
| 111 | - README this file |
| 112 | - resources/ resource files that will be included in the JOSM jar file |
| 113 | - data/ data files that will be included in the JOSM jar file |
| 114 | - fonts/ font files used for map rendering |
| 115 | - gpx/ different color gradients for gpx drawing |
| 116 | - projection/ projection files |
| 117 | - custom-epsg list of projection definitions, auto-generated file created by ant task 'epsg' |
| 118 | - security/*.pem certificates that we like to accept for TLS connections, but are missing in the |
| 119 | default Java certificate store |
| 120 | - validator/ data files used by the JOSM validator |
| 121 | - *.cfg files designed for the old tagchecker, still in use |
| 122 | - *.mapcss default validation rules for the MapCSS-based tagchecker |
| 123 | - boundaries.osm OSM file containing boundary data for the states of the earth, including |
| 124 | data for right and left-hand traffic |
| 125 | - defaultpresets.xml data file for the core tagging presets |
| 126 | - help-browser.css CSS file for the help sites (HTML content is downloaded from the website |
| 127 | on demand, but displayed inside the programm in a Java web browser component.) |
| 128 | - *.lang translation data |
| 129 | - *.xsd xml schema files for validation of configuration files |
| 130 | - images/ images distributed with the JOSM binary |
| 131 | - icons images for the Potlatch 2 style |
| 132 | - presets images for the main mappaint style and the internal presets |
| 133 | - styles/ map styles included in JOSM |
| 134 | - scripts/ various scripts used by JOSM developers |
| 135 | - BuildProjectionDefinitions.java |
| 136 | called from the ant build file to combine the files epsg and josm-epsg |
| 137 | to create the custom-epsg file for distribution |
| 138 | - geticons.pl tool to find all used icons and allows deleting unused icons |
| 139 | searches also for images with incompatible svg code |
| 140 | - optimize-images short script to decrease size of PNG images |
| 141 | - since_xxx.py developer tool to replace "@since xxx" in Javadoc by the upcoming revision number |
| 142 | - SyncEditorLayerIndex.java |
| 143 | script to compare and analyse the differences of the editor layer index and the |
| 144 | JOSM imagery list (see https://josm.openstreetmap.de/wiki/ImageryCompare) |
| 145 | - TagInfoExtract.java extracts tag information for the taginfo project |
| 146 | - src/ the source code of the application |
| 147 | - start.html HTML page to run the applet version of JOSM |
| 148 | - test/ automated software tests |
| 149 | - data/ resources used for some tests |
| 150 | - functional/ functional tests (source code) |
| 151 | - lib/ libraries needed for (some of) the tests, including JUnit |
| 152 | - performance/ performance tests (source code) |
| 153 | - unit/ unit tests (source code) |
| 154 | - tools/ libraries, tools and configuration files that help in the development process |
| 155 | - checkstyle/ libs and config files for checkstyle (automatically detects code style |
| 156 | problems in source code); can be launched as an ant target in build.xml |
| 157 | - eclipse/ preconfigured Eclipse configuration files |
| 158 | - ivy/ Apache Ivy binary, configuration file, and downloaded dependencies |
| 159 | - jacocoant.jar used to include coverage data into JUnit test reports |
| 160 | - japicc/ used to generate a compatibility report between optimized jar and normal one |
| 161 | - netbeans/ preconfigured Netbeans project |
| 162 | - pmd/ config files for PMD (source code analyzer, finds common programming flaws) |
| 163 | - spotbugs/ libs and config files for spotbugs (automatically detects common bugs and potential |
| 164 | problems in source code); can be launched as an ant target in build.xml |
| 165 | ``` |
| 166 | |
| 167 | |
| 168 | ### Third party libraries |
| 169 | |
| 170 | There are some third party libraries which are directly included in the source code tree, in particular: |
| 171 | |
| 172 | * jmapviewer `src/org/openstreetmap/gui` ([svn external](https://josm.openstreetmap.de/osmsvn/applications/viewer/jmapviewer/)) |
| 173 | * Java component to browse a TMS map |
| 174 | * Apache commons compress ([github](https://github.com/apache/commons-compress)) |
| 175 | * Support for bzip2 compression when opening files |
| 176 | * Apache commons validator `src/org/openstreetmap/josm/data/validation/routines` ([apache](http://commons.apache.org/proper/commons-validator)) |
| 177 | * Improved validator routines |
| 178 | * SVG Salamander ([github](https://github.com/blackears/svgSalamander)) |
| 179 | * Support for SVG image format |
| 180 | * Metadata Extractor ([github](https://github.com/drewnoakes/metadata-extractor)) |
| 181 | * Read EXIF Metadata of photos |
| 182 | * Signpost ([github](https://github.com/mttkay/signpost)) |
| 183 | * OAuth library |
| 184 | * MultiSplitPane `src/org/openstreetmap/josm/gui/MultiSplitLayout.java, MultiSplitPane.java` ([github](https://github.com/floscher/multi-split)) ([oracle](https://community.oracle.com/docs/DOC-983539)) |
| 185 | * Small lib for GUI layout management |
| 186 | * swinghelper `src/org/openstreetmap/josm/gui/util/CheckThreadViolationRepaintManager.java` ([github](https://github.com/floscher/swinghelper)) |
| 187 | * Class CheckThreadViolationRepaintManager to find EDT violations |
| 188 | * xz extractor ([website](https://tukaani.org/xz/java.html)) |
| 189 | * OpeningHoursParser (MIT license) ([github](https://github.com/simonpoole/OpeningHoursParser)) |