Java Runtime Environment

From OpenStreetMap Wiki
Jump to navigation Jump to search
Java mascot “Duke”

Java Runtime Environment is a part of the Java platform. The Java platform refers to a group of software products from Oracle. The platform is used to develop and run Java programs. The platform includes the execution engine (called a Java Virtual Machine) that allows the same Java program file to run on different operating systems. This is a big advantage.

On the other hand, Java applications do require a "Java Runtime Environment" (JRE), and this installation does depend on the operating system you are running. This page explains how to install JRE on your machine and how to run a Java application though the Java runtime.

Also see Wikipedia's explanation of Java Runtime Environment.

Much software in the OSM ecosystem depends on the Java Runtime Environment:

How to install

If you are not interested in running applets inside the web browser you might choose not to install any browser plugins/extensions. They are not needed for running Java desktop programs (like the OSM editor JOSM) but frequently pose a security risk. You also could disable the browser plugin afterwards or use your browser's controls to disable or enable.

Windows

  1. Download the installer from java.com or pick "JRE" at oracle.com if you want to use a new, not yet mainstream, version.
  2. Run it (in case you need them, instructions are linked on the download page).
    • The default options are generally okay (installs to "Program Files/Java") except …
      • It is a good idea to not install any additional advertised crap software (search bars, security checkers, …) – uncheck this during the install procedure.
      • It is also a good idea to not install the browser plugin or disable "web content" afterwards in the Java settings (see above for more info).
      • Maybe you would also want to disable the 'java update checker' since this will add a new auto start-up item (one of those things which slows down start-up times very slightly). However, then you need to manually check for new Java versions (important if you use the browser plugin/extension).
      • Good news: At least the current 64-bit offline installer (only this was tested) for Oracle's Java 8 seems to not contain crap software. Also, it seems not to enable "web content" (browser plugin) by default.

macOS

Minimum system requirements

Java JRE 9: Mac OS 10.10+

Java JRE 8: Mac OS 10.7.3+

Java JRE 6 (provided by Apple): Mac OS 10.5 – 10.6 only

Java JRE 1.5 (provided by Apple): Mac OS 10.4

Check which Java version you have in macOS

There are several ways to figure out which version of Java you have:

  • System prefs method: Under 'System preferences' see the 'java' icon, then got to 'update' tab to see if you're up to date.
  • Terminal method: Open a terminal and type: java -version. Ideally the output would look like this (in this example it is Java version 7):
    java version "1.7.0_40"
    Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
    Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
    
  • Web method: Test which version of Java you have online (only work if you use the Java browser plugin which is not recommended for security reasons)

Download Java from Oracle for macOS

  1. If you're upgrading from an earlier Java version you may have to uninstall it before. More information about how to install and uninstall Java on a Mac can be found on java.com. Note if you use the Chrome browser, this could cause very few websites (those which use java) to stop working.
  2. Download the installer from java.com.
  3. Install from the dmg file as usual. For more info see the links there to Oracle's "install guide" or "system requirements" for Java on macOS.

For how to run a Java program, see the section further down this page.

Linux

  • Use your distribution's package installer/manager to install a Java VM (JRE). This will automatically keep the Java version updated. Often the JRE from OpenJDK, the free software version of Oracle's implementation, is available in the default repositories. Some distribution-specific instructions follow.
  • Alternatively, install Oracle's Java from Java.com. Multilingual install help available (e.g. German, Japanese, Russian).

Arch Linux

Debian

See refer to "User documentation" section at Debian wiki.

Or see the following older info. "Older" because Java Version 6 is totally outdated. You likely want to use a newer one and OpenJDK.

  • enter (as root):
    $ apt-get install sun-java6-jre

Note: If you have another JVM installed and want to use SUN's java, start JOSM with

JAVACMD=/usr/lib/jvm/java-6-sun/bin/java josm

Gentoo

See "Installing a JRE/JDKs" section at gentoo wiki.

Standard installation with Portage:

emerge -av sun-jre-bin

Gentoo ebuild collections has some OSM Java applications. By installing one of it, you can install the JRE as a dependence. For example:

emerge -av josm

There are many plug-ins already available as ebuilds. Look at https://svn.openstreetmap.org/applications/utils/gentoo/ for a complete list. If you are interested in latest development version of java applications and extra plugins of them use the OpenStreetMap Gentoo Overlay.

openSUSE/Fedora/Mandriva

See the "Installing Java" article at the openSUSE Support Database.

Ubuntu

See for example …

FreeBSD

See the guide at freebsd.org.

How to run a Java application

Main article: How to run java applications