How to change Java version used by TOMCAT?
When you open catalina.sh / catalina.bat, you can see :
Environment Variable Prequisites
JAVA_HOME Must point at your Java Development Kit installation.
So, set your environment variable JAVA_HOME
to point to Java 6. Also make sure JRE_HOME
is pointing to the same target, if it is set.
Update: since you are on Windows, see here for how to manage your environment variables
How to change Java Version for Apache Tomcat 9
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 namedsetenv.sh
and putJAVA_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.
How to configure Tomcat to use Java 7
You answered your own question.! :)
All You need to do is link java 7 in your JAVA_HOME
.!
More Info Here
Edit : (Based on alfabravo's comment :
You can definitely change the pointer to JAVA_HOME
in your catalina.bat/sh
What will happen if i change the java version in tomcat to latest version
Most probably No.
But Yes in some cases,Tomcat may counter the issues about Incompatibilities between JDK 7 and JDK 6
http://www.oracle.com/technetwork/java/javase/compatibility-417013.html#jdk7
Related Topics
Installing Java on Os X 10.9 (Mavericks)
Why Does Intellij Give Me "Package Doesn't Exist" Error
Jackson/Hibernate, Meta Get Methods and Serialization
Cleanest Way to Toggle a Boolean Variable in Java
Add Multiple Items to an Already Initialized Arraylist in Java
Difference Between Static and Final
Logging User Activity in Web App
Is It Bad Practice to Make a Setter Return "This"
How to Prevent Eclipse from Hanging on Startup
JSON Gson.Fromjson Java Objects
Convert Localdate to Localdatetime or Java.Sql.Timestamp
How to Configure Httponly Cookies in Tomcat/Java Webapps