Java – Make tomcat use Oracle Java, instead of OpenJDK

apache-2.2centos6javatomcat6

I have a webapp from Atlassian, called as Crowd, in order for this app to function, i need to have tomcat, and OracleJDK. the app provides a tomcat container, but that is not what i want.
I want to install tomcat, so i can get the JSCV daemon installed, which will be used by me to use the Virtual Host.

Now, the question is, is it possible to have both openJDK and oracleJava installed on the same machine?
Is it possible to make tomcat use Oracle JAVA instead of openJDK.

if tomcat uses OracleJava, can i still use, JSCV to function on the machine so i can use my virtual servers.

PS
-Crowd Installation is not an issue, just posted it so you know what is my aim
-Crowd only works with oracle Java, 1.6 and 1.7 only
-Server OS is CentOS, and the primary OS, which will run apache is a Ubuntu Instance(might be irrelevant)

Best Answer

Now, the question is, is it possible to have both openJDK and oracleJava 
installed on the same machine? Is it possible to make tomcat use Oracle JAVA
instead of openJDK.

Yes.

Set (export) JAVA_HOME variable to wherever the jre you want to use is installed before starting tomcat.

To change default java, you can follow this documentation.

Related Topic