Upgrading Java
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.
Update service wrapper
Find the file jvm.dll
in the Java installation.
Java 8: this will be in
JAVA_HOME\jre\bin\server\jvm.dll
Java 11: this will be at
JAVA_HOME\bin\server\jvm.dll
Open Tomcat Properties window. If you need further details on how to open this, see: Managing Tomcat
Go to the Java tab. Update the Java Virtual Machine setting to the new location of jvm.dll
.
Unknown Attachment
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 replace the previous version.
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 Java), 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:
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
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:
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:
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