- If you will be installing a new JDK, download the “tar.gz” version of the needed JDK version first.
- Connect to your server via SSH and place the downloaded file into the location: /usr/local/
scp-P 2222 /File-Path-On-Your-PC/JDK-File\_Name.tar.gzroot@Your-Server-IP:/usr/local
Note* Please replace the file paths/names with the ones appropriate in yourcase. If you are running an SSH client over Windows OS you may need an additional plug-in to use SCP, consult your SSH application help section.
After the upload is complete, change to our working directory with: cd/usr/local/
- Run the following command once inside the directory:
tar-xzvf JDK-File-Name.tar.gz
and then
rm JDK-File-Name.tar.gz
- Next, the “catalina.sh” file needs to be edited. The file is located here:
nano/home/username/jvm/your-apache-tomcat-folder/bin/catalina.sh
or alternatively
vi/home/username/jvm/your-apache-tomcat-folder/bin/catalina.sh
Add the following data to the second row of the file along with the quotes:
JAVA\_HOME="/usr/local/Extracted-JDK-Folder-Name/"
If you are only changing between already installed JDK versions, simply change the “catalina.sh” file by changing the folder name to the one you wish to use!
Save the file and restart your JVM from your cPanel, the new JDK should now be working fine.
If you need additional assistance or would like to have the JDK Tool installed on your server, please contact us via our LiveChat support channel, we will be happy to assist you!
