Skip to content

Building Apache Tomcat

linuxonz edited this page Apr 18, 2024 · 67 revisions

Building Apache Tomcat

Below versions of Apache Tomcat are available in respective distributions at the time of creation of these build instructions:

  • RHEL (7.8, 7.9) have 7.0.76
  • RHEL (8.6, 8.8, 8.9, 9.0, 9.2, 9.3) have 9.0.62
  • SLES 12 SP5 has 9.0.36
  • SLES 15 SP5 has 9.0.75
  • Ubuntu 20.04 has 9.0.31
  • Ubuntu 22.04 has 9.0.58
  • Ubuntu 23.10 has 10.1.10

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Apache Tomcat binaries are available and can be downloaded from here. To use these binaries, different Java flavors can be installed on mentioned distributions.

Note: Apache Tomcat(v10.1.20) was verified at the time of creation of these instructions

1. Install Java

   export SOURCE_ROOT=/<source_root>/
  • RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)

    • With OpenJDK11:

      sudo yum install -y java-11-openjdk-devel
    • With OpenJDK17 (Except RHEL 7.x):

      sudo yum install -y java-17-openjdk
    • With OpenJDK 21 (Except RHEL 7.x):

      sudo yum install -y java-21-openjdk-devel
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      • Download and install IBM Semeru Runtime (Java 11, Java 17 or Java 21) from here.
    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11, Java 17 or Java 21) from here.
  • SLES (12 SP5, 15 SP5)

    • With OpenJDK11:

      sudo zypper install -y java-11-openjdk-devel
    • With OpenJDK17 (Except SLES 12 SP5):

      sudo zypper install -y java-17-openjdk
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      • Download and install IBM Semeru Runtime (Java 11, Java 17 or Java 21) from here.
    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11, Java 17 or Java 21) from here.
  • Ubuntu (20.04, 22.04, 23.10)

    • With OpenJDK11:

      sudo apt-get update
      sudo apt-get install -y openjdk-11-jdk
    • With OpenJDK17:

      sudo apt-get update
      sudo apt-get install -y openjdk-17-jdk
    • With OpenJDK 21

      sudo apt-get install -y openjdk-21-jdk
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      • Download and install IBM Semeru Runtime (Java 11, Java 17 or Java 21) from here.
    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11, Java 17 or Java 21) from here.

Note: At the time of creation of these build instructions, Apache Tomcat 10.1.20 was verified with OpenJDK 11 (build 11.0.19+7-LTS), OpenJDK 17 (build build 17.0.7+7) and OpenJDK 21 (build build 21.0.1+12), OpenJDK Runtime Environment Temurin-11.0.19.7 (build 11.0.19+7), OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7) and OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12) and IBM Semeru Runtime Open Edition 11.0.19.7 (build 11.0.19+7), IBM Semeru Runtime Open Edition 17.0.7.7 (build 17.0.7+7) and IBM Semeru Runtime Open Edition 21.0.1+12 (build 21.0.1+12).

2. Set environment variables

export JAVA_HOME=<Path to Java>
export PATH=$JAVA_HOME/bin:$PATH

3. Start server

To start the server, extract the binary tar to /<source_root>/ and follow steps given below:

cd $SOURCE_ROOT/<apache_tomcat_binary_folder>/
bin/startup.sh

Open http://<ip_address>:8080/ in your browser to access Web UI.

References:

Clone this wiki locally