This section demonstrates the installation of the Java JDK and the Tomcat Servlet Container binaries.

System Requirements

  • OpenJDK Java 11 (latest version)
  • Apache Tomcat 8.x

While there are different distributors of Java and servlet containers, Unidata develops, uses and tests the THREDDS Data Server using OpenJDK Java and the Apache Tomcat servlet container.

Installing OpenJDK Java JDK

The following example shows the JDK installation on a linux system.
The installation is being performed as the root user.

  1. Download current OpenJDK 8 (LTS) JDK version from the AdoptOpenJDK site.

  2. Install the JDK.

    Copy the binary tar.gz file into the installation directory (/usr/local in this example):

    # pwd
    /usr/local
        
    # cp /tmp/jdk-8u192-linux-x64.tar.gz .
    
    # ls -l
    total 187268
    -rw-r--r-- 1 root root 191757099 Oct 24 13:19 jdk-8u192-linux-x64.tar.gz
    

    Unpack the archive file:

    # tar xvfz jdk-8u192-linux-x64.tar.gz 
    

    This will extract the JDK in the installation directory:

    # ls -l
    total 187272
    drwxr-xr-x 7 root root      4096 Oct  6 07:58 jdk1.8.0_192
    -rw-r--r-- 1 root root 191757099 Oct 24 13:19 jdk-8u192-linux-x64.tar.gz
    

    Remove the remaining binary tar.gz file when the installation is complete.

    # rm jdk-8u192-linux-x64.tar.gz
    # ls -l
    total 187279
    drwxr-xr-x 7 root root      4096 Oct  6 07:58 jdk1.8.0_192
    

Installing The Tomcat Servlet Container

The following example shows Tomcat installation on a linux system. (This type of installation will work on Mac OS systems as well.) The installation is performed as the root user.

  1. Download current version of the Tomcat 8.5 servlet container.

  2. Install Tomcat as per the Apache Tomcat installation instructions.

    Copy the binary tar.gz file into the installation directory (/usr/local in this example):

    # pwd
    /usr/local
        
    # cp /tmp/apache-tomcat-8.5.34.tar.gz .
    
    # ls -l
    total 196676
    -rw-r--r-- 1 root root   9625824 Oct 24 13:27 apache-tomcat-8.5.34.tar.gz
    drwxr-xr-x 7 root root      4096 Oct  6 07:58 jdk1.8.0_192
    

    Unpack the archive file:

    # tar xvfz apache-tomcat-8.5.34.tar.gz
    

    This will create a Tomcat directory:

    # ls -l
    total 196680
    drwxr-xr-x 9 root root      4096 Oct 24 13:29 apache-tomcat-8.5.34
    -rw-r--r-- 1 root root   9625824 Oct 24 13:27 apache-tomcat-8.5.34.tar.gz
    drwxr-xr-x 7 root root      4096 Oct  6 07:58 jdk1.8.0_192
    

    Remove the remaining binary tar.gz file when the installation is complete.

    # rm apache-tomcat-8.5.34.tar.gz
    # ls -l
    total 187282
    drwxr-xr-x 9 root root      4096 Oct 24 13:29 apache-tomcat-8.5.34
    drwxr-xr-x 7 root root      4096 Oct  6 07:58 jdk1.8.0_192
    

Adding symbolic links for both the Tomcat and the JDK installations will allow for upgrades of both packages without having to change to configuration files and server startup/shutdown scripts.

The following example shows creating symbolic links for the Tomcat and JDK installation on a linux system. (This type of installation will work on Mac OS systems as well.) The installation is performed as the root user.

  1. Create symbolic links for the Tomcat and the JDK installations:

     # pwd
     /usr/local
        
     # ln -s apache-tomcat-8.5.34 tomcat 
     # ln -s jdk1.8.0_192 jdk
     # ls -l 
     total 196684
     drwxr-xr-x 9 root root      4096 Oct 24 13:29 tomcat -> apache-tomcat-8.5.34
     drwxr-xr-x 9 root root      4096 Oct 24 13:29 apache-tomcat-8.5.34
     lrwxrwxrwx 1 root root        12 Oct 24 13:59 jdk -> jdk1.8.0_192
     drwxr-xr-x 7 root root      4096 Oct  6 07:58 jdk1.8.0_192
    

Next Step

Next, we’ll do a quick tour of the relevant elements of the Tomcat Directory Structure and how these elements relate to the TDS.