Setting the Oracle JVM

We recommend using the Oracle JVM with OpenGeo Suite, as testing has shown that the Oracle JVM is significantly faster than other JVM implementations.

Specifically, we recommend using Oracle JRE 7. Even though it isn’t the latest version, it is the most well-tested and stable version of the JVM with GeoServer.

Determining the current Java version

You may wish the verify the version of Java you are currently using.

Warning

On Linux, packages may pull in multiple versions of the JRE, so just running java -version may not accurately reflect the version of the JRE being used by OpenGeo Suite.

To confirm the version of Java used:

  1. Log in to the GeoServer admin interface.

  2. Navigate to the Server Status page, found on the left side under About & Status.

    ../../_images/jvm_serverstatuslink.png

    Click to open the Server Status page

  3. The JRE used by GeoServer is listed in the JVM Version entry.

    ../../_images/jvm_version.png

    JVM Version showing OpenJDK 7

Note

When using Tomcat, an alternate way of checking the JRE is to log into the Using Tomcat Manager and view the settings there.

../../_images/jvm_tomcat.png

JVM settings in Tomcat

Changing to the Oracle JRE

Windows and OS X installers

OpenGeo Suite for Windows and OS X include the Oracle JRE 7 by default, so no action is needed.

Linux

  1. Download the Oracle JRE. In your browser, navigate to Oracle’s download page for JRE 7.

  2. Click the radio box to accept the license agreement and then click the download link that matches your system:

    jre-7u76-linux-x64.tar.gz
    
  3. Extract the download file contents to your temporary directory or desktop.

  4. In a terminal, change to the directory that contains the extracted folder.

  5. Move this directory to /usr/lib/jvm (or wherever you’d like to place your JRE):

    sudo mv jre1.7.0_76 /usr/lib/jvm
    
  6. (Optional) Change your JAVA_HOME environment variable to point to this new directory:

    export $JAVA_HOME=/usr/lib/jvm/jre1.7.0_76
    
  7. Ensure your application server is using this new Java. Many application servers will pick up the system JAVA_HOME environment variable or require that their service definition be modified.

  8. If using OpenGeo Suite packages (or just using Tomcat) open /etc/default/tomcat7 in a text editor.

  9. Scroll down to the end of the file where the JAVA_HOME variable is set. Add the line:

    OPENGEO_OPTS="-Djava.awt.headless=true -Xms256m -Xmx768m -Xrs -XX:PerfDataSamplingInterval=500 -XX:MaxPermSize=256m -Dorg.geotools.referencing.forceXY=true -DGEOEXPLORER_DATA=/var/lib/opengeo/geoexplorer"
    JAVA_OPTS="$JAVA_OPTS $OPENGEO_OPTS"
    JAVA_HOME=/usr/lib/jvm/jre1.7.0_76
    
  10. Save and close the file.

  11. Restart Tomcat.

  12. OpenGeo Suite should now be using the new version of Java. Verify in GeoServer by navigating to the Server Status page.

    ../../_images/jvm_serverstatusoracle.png

    JVM Version showing Oracle JRE on Linux

  13. On the line named JVM Version, you should see the Oracle JRE. (For historical reasons, it will be shown as “Java HotSpot.”)

Note

Read more about running OpenGeo Suite in Production.

Windows application servers

Note

As mentioned above, OpenGeo Suite for Windows automatically includes the appropriate JRE. No action is needed.

If running OpenGeo Suite for Application Servers on a Windows system:

  1. Download the Oracle JRE. In your browser, navigate to Oracle’s download page for JRE 7.

  2. Click the radio box to accept the license agreement and then click the download link that matches your system:

    jre-7u76-windows-x64.exe
    
  3. Use the installer (or manual directions) to update Java.

    Warning

    When installing a new Java Runtime Environment from Oracle, pay careful attention to the installation wizard. Oracle has a habit of including unwanted extras such as JavaFX and browser toolbars, so make sure you uncheck everything during the install process.

  4. (Optional) Change your JAVA_HOME environment variable to point to this new directory. From the System Control Panel select Advanced System Settings. From the System Properties dialog navigate to the Advanced Tab and click Environment Variables. Define a System Variable by clicking New and entering:

    New System Variable
    Variable name Variable value
    JAVA_HOME C:\Program Files\Java\jre7
  5. Restart your application server.

  6. Make sure that your application server is using this new Java. It may be reading the JAVA_HOME environment variable, or you may need to consult your application server documentation.

  7. OpenGeo Suite should now be using the new version of Java. Verify in GeoServer by navigating to the Server Status page.

    ../../_images/jvm_serverstatuswindows.png

    GeoServer Server Status page showing Oracle JRE on Windows

  8. On the line named JVM Version, you should see the Oracle JRE. (For historical reasons, it will be shown as “Java HotSpot.”)

Note

Read more about running OpenGeo Suite in Production.