TLS offloading
Apache Tomcat
Configuring environment variables for Apache Tomcat
1min
apache tomcat relies on several environment variables to function correctly select one of the following operating systems to set the required environment variables 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/jdk 11 oracle x64 determine the installation path of tomcat you can use the find command to locate the tomcat installation directory sudo find / name "catalina sh" catalina sh is stored 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 path with the actual path to your oracle java installation export java home=/path/to/jdk export catalina home=/path/to/tomcat export ld library path=/usr/local/bin/fxpkcs11/libfxpkcs11 so export fxpkcs11 cfg=/etc/fxpkcs11 cfg 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 environment variables are set correctly and the path is updated, check their values with the following commands echo $java home echo $catalina home echo $ld library path echo $fxpkcs11 cfg echo $path you should see the individual paths set for java home and catalina home , as well as their inclusion in the path determine the installation path of oracle java ensure oracle java is installed on your system note the installation path, typically something similar to 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 go to 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, under the system variables section, select \[ new ] 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 ) for ld library path variable name ld library path variable value the path to your fxpkcs11 library (such as c \program files\futurex\fxpkcs11\fxpkcs11 dll ) for fxpkcs11 cfg variable name fxpkcs11 cfg variable value the path to your fxpkcs11 configuration file (such as c \program files\futurex\fxpkcs11\fxpkcs11 cfg ) update the path variable in the system variables section, find and select the path variable, and select \[ edit ] add new entries select \[ new ] and add %java home%\bin select \[ new ] and add %catalina home%\bin apply the 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 (press win + r , type cmd , and select the enter key) 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 %ld library path% and select the enter key you should see the path to the futurex pkcs #11 module enter echo %fxpkcs11 cfg% and select the enter key you should see the path to the futurex pkcs #11 configuration file 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