Setting the JVM

This section will discuss JVM (Java) settings for use with Boundless Suite.

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

Specifically, we recommend using Oracle JRE 8. The current GeoServer release requires a Java 8 JVM.

Determining the current Java version

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

Warning

It is possible to have multiple versions of the JRE installed, so just running java -version may not accurately reflect the version of the JRE being used by Boundless 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

Changing to the Oracle JRE

Linux

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

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

    jre-8u77-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.8.0_77 /usr/lib/jvm
    
  6. (Optional) Change your JAVA_HOME environment variable to point to this new directory:

    export $JAVA_HOME=/usr/lib/jvm/jre1.8.0_77
    
  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 Boundless Suite packages (or just using Tomcat) open /etc/tomcat8/tomcat8.conf in a text editor.

  9. Near the top of the file, the JAVA_HOME variable is set. Change it to:

    # This is the $JAVA_HOME of JDK, not JRE. not needed if you've setup
    # the file "/etc/profile.d/java.sh" with this variable.
    JAVA_HOME=/usr/lib/jvm/jre1.8.0_77
    

    Note

    Make sure the line is uncommented (does not start with #).

  10. Save and close the file.

  11. Restart Tomcat.

  12. Boundless 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.”)

Windows application servers

If running Boundless Suite in an application server on a Windows system:

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

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

    jre-8u77-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:

    Variable name Variable value
    JAVA_HOME C:\Program Files\Java\jre8
  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. Boundless 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 installing Java on Windows.

Setting the default JVM using update-alternatives

If you used linux packages to install different versions of java and are using the Boundless Suite packages you can use the update-alternatives command to set the default java for your system.

Note

This method may change the java version other applications are using on your server. This may cause issues.

  1. Run the command;

    update-alternatives --config java
    
  2. You will be presented with a list of installed Java versions. Choose the one you would like to use.

    There are 2 programs which provide 'java'.
    
       Selection    Command
    -----------------------------------------------
     *+ 1           /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
        2           /usr/java/jre1.8.0_101/bin/java
    
    Enter to keep the current selection[+], or type selection number:
    
  3. Verify by running;

    java -version
    
  4. Restart Tomcat