So I'm running apache tomcat 9, when I check the /manager
page it shows the jvm version as 11.0.8+10-post-Ubuntu-0ubuntu118.04.1
.
I want to use Java version 8, how would I change this?
I have read around online and could not find anything that works.
OS: ubuntu 18.04
It's not a duplicate because I have read that post already and I found the answers unhelpful / not working. (Also that thread is targeted toward the windows OS as I'm based on Ubuntu (CLI only).)
There are multiple ways of doing so.
Chaining global JAVA_HOME
environment variables to the java you wish to use. Note that this will change Java for all apps running on that machine.
Using setenv file. In CATALINA_BASE/bin
directory open or create file named setenv.sh
and put JAVA_HOME=/usr/lib/jvm/openjdk-8-jdk
in it. This will change it only for your tomcat. Please note to change it to the JDK/JRE you want to use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With