TLS offloading
Apache Tomcat

Configure environment variables for Apache Tomcat

2min
you must correctly configure the java home environment variable to enable java applications and tools to locate the installed jdk (java development kit) on your system apache tomcat also requires the catalina home environment variable to point to the directory where tomcat is installed this section shows how to set the java home and catalina home environment variables and update the system path variable on linux and windows operating systems to ensure proper compatibility between java sunpkcs11 and the {{futurex}} pkcs11 module, you must use oracle java and not openjdk oracle java 11, 17, and 21 are currently supported select your operating system and follow the instructions linux determine the installation path of oracle java find the path where oracle java is installed, such as /usr/lib/jvm/ use the following command to list the installed jdks ls /usr/lib/jvm/ for example, if you installed oracle java 11, the path is likely /usr/lib/jvm/java 11 openjdk amd64 determine the installation path of tomcat you can use the find command to locate the tomcat installation directory sudo find / name "catalina sh" the catalina sh script is located in the bin directory of the tomcat installation the directory containing catalina sh is the catalina home edit the profile file open a terminal and use a text editor to edit the /etc/profile file, which the system uses when users log in you might need superuser privileges to edit this file sudo nano /etc/profile add the environment variables and update path add the following lines to the end of the /etc/profile file, replacing the paths with your actual installation paths export java home=/path/to/jdk export catalina home=/path/to/tomcat export path=$path $java home/bin $catalina home/bin apply the changes after saving the file, apply the changes by sourcing the profile file source /etc/profile verify the configuration to ensure that the java home variable is set correctly and the path is updated, you can check their values with the following commands echo $java home echo $catalina home echo $path you should see the individual paths set for java home and catalina home , as well as their inclusion in the path windows determine the installation path of oracle java ensure oracle java is installed on your system note the installation path, typically something like c \program files\java\jdk 11 determine the installation path of tomcat ensure apache tomcat is installed on your system note the installation path common default installation paths include c \program files\apache software foundation\tomcat or c \tomcat open system properties select the win + pause/break keys to open the system properties window, or right click this pc (or my computer ) and select properties select advanced system settings on the left sidebar open environment variables in the system properties window, select \[ environment variables ] near the bottom of the window create new system variables in the environment variables window, in the system variables section, select \[ new ] this opens the new system variable dialog enter the following for java home variable name java home variable value the path to your jdk installation (such as c \program files\java\jdk 11 ) for catalina home variable name catalina home variable value the path to your tomcat installation (such as c \program files\apache software foundation\tomcat or c \tomcat ) update the path variable in the system variables section, find and select the path variable, then select \[ edit ] this opens the edit environment variable dialog add new entries select \[ new ] and add %java home%\bin select \[ new ] and add %catalina home%\bin apply changes select \[ ok ] on each dialog box to apply the changes and exit the dialog boxes verify the configuration open a new command prompt window (select the win + r keys, type cmd , and press enter) enter echo %java home% and select the enter key you should see the path to your jdk installation enter echo %catalina home% and select the enter key you should see the path to your tomcat installation enter echo %path% and select the enter key you should see the java home and catalina home environment variables included in the path enter java version to confirm that the system recognizes the java installation