Windows
Stop Tomcat
See Managing Tomcat
Install new Java version
Follow instructions to install Java: Install Java
Update JAVA_HOME
...
Setting JAVA_HOME is not part of the standard installation of Java for PhixFlow, but some operators set this for use with other programs on the same server.
If someone has set the environment variable JAVA_HOME, check whether this needs updating in the system environment variables. Commonly this will be automatically updated by the installation process.
...
Open Tomcat Properties window. If you need further details on how to open this, see: Managing Tomcat start/ stop, open properties
Go to the Java tab. Update the Java Virtual Machine setting to the new location of jvm.dll
.
...
Status | ||
---|---|---|
|
If you have moved between major versions of Java (e.g. you are moving from Java 8 to Java 11), update the Java arguments as instructed here: Install Tomcat on Windows
Remove old version
Installation of a new patch of Java should remove the previous version, but you should confirm that replace the previous version has been removed by examining the list of installed programs.
If you are migrating to a new major version of Java (e.g. you are moving from Java 8 to Java 11), you will need to remove the previous version from the list of installed programs.
Start Tomcat
See Managing Tomcat
Linux
Stop Tomcat
See Managing Tomcat
Minor (patch) upgrades
If you have installed Java as recommended by PhixFlow (Install
...
Follow instructions to install Java: Install Java
Update JAVA_HOME
If you have followed the standard installation instructions, you have already done thisJava), upgrade Java as recommended for any package installed using the package manager. For example, on Debian based distributions of linux, the generally recommended approach is by using dist-upgrade
.
Major upgrades
If you are upgrading between major versions of Java, you will need to remove the current installation of Java, and install the new version.
Remove the existing Java installation using the standard method for packages installed using the package manager. For example, on Debian based distributions, to remove Java 8 Adoptium OpenJDK, use the commands:
Code Block |
---|
sudo apt-get remove temurin-8-jdk
sudo apt-get purge --auto-remove temurin-8-jdk |
Then install the new version of Java using the instructions given at Install Java, starting from sudo apt-get update
(you do not need to re-install or update the Adoptium repository).
Update service script
Open the tomcat service script at /etc/systemd/system/tomcat.service
Update JAVA_HOME
in the script to the value of $JAVA_HOME
in your environment. You must make this the full path for the Java installation, you cannot refer to the environment variable in the script. The resulting file will look similar to this:
Code Block |
---|
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
Environment=JAVA_HOME=/opt/jdk/jdk-11.0.13+8
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat |
Remove old version
If you installed Java following PhixFlow’s recommended installation (Install Tomcat on Linux), delete the previous installation
Code Block |
---|
cd /opt/jdk
sudo rm -r [PREVIOUS VERSION] |
For example
Code Block |
---|
sudo rm -r /opt/jdk/jdk-11.0.13+8 |
...
The following instructions assume that you have followed the recommended installation instructions for installing Tomcat: Install Tomcat on Linux. If you have taken a different approach, ensure that you update JAVA_HOME, or which ever setting specifies the installation directory for Java, in your startup process for Tomcat.
You may need to update the JAVA_HOME setting in the service script for Tomcat.
To find the new setting, run the command:
Code Block |
---|
update-alternatives --list java |
This will give you the full path of the java program, for example: /usr/lib/jvm/temurin-11-jdk-amd64/bin/java
. The installation directory in this case is /usr/lib/jvm/temurin-11-jdk-amd64
.
Check whether this is different from the current setting of JAVA_HOME in /etc/systemd/system/tomcat.service
. If this is different, update /etc/systemd/system/tomcat.service
to use the new setting for JAVA_HOME, and before you restart the tomcat process, run the command:
Code Block |
---|
sudo systemctl daemon-reload |
Moving from Java 8 to Java 11
If you have moved from Java 8 to Java 11, update CATALINA_OPTS in /etc/systemd/system/tomcat.service
for the the new logging settings at that version of Java, as instructed here: Install Tomcat on Linux
Start Tomcat
See Managing Tomcat