I have a server running rhel5 and jre 1.6. All my apps are running perfectly for now. But I want to install java 1.7 but keeping java 1.6 as the default so my running apps want be affected. If I want to install java 1.7 from a rpm how can I do this, and how can I run a my new app with the new version of java without changing default java version
Redhat – Multiple java versions
classpathjavaredhat
Best Answer
Install the java versions you want, running applications should not be affected despite the default java version being changed. Then run the
alternatives
utility to pick your default java version:Verify your setup with
If you're unsure, try this on a non-production host first.
Edit: To force tomcat to use a specific java version, no matter what the default, place a
setenv.sh
in tomcat'sbin
directory containingSource: https://stackoverflow.com/questions/1698913/how-to-set-java-home-in-tomcat-config