install sun java 6 and sun java 7 side-by-side on linux (fedora 16) using rpm

Solution 1:

I had similar problems getting Oracle java and OpenJDK to exist side by side on Fedora 16. I followed the guide on If not True then False and it worked perfectly.

Solution 2:

This is the more simple way, when you get this error:

package jdk.... (which is newer than jdk...) is already installed

Use the --force flag to install multiple versions.

So for example:

sudo rpm -ivh --force jdk-6u35-linux-amd64.rpm

Solution 3:

jdk-7u2-linux-x64.rpm is newer than jdk-6u30-linux-amd64.rpm and the RPM package management tool is smart enough to overwrite it with the newer release.

The easiest way to install sun java 6 and sun java 7 side-by-side is to download the Java tarballs from Oracle and extract them into /opt