Upgrading to Java 7 on Linux

April 10, 2013
java

Today I upgraded Java from 1.6 to 1.7 on a CentOS (RHEL) 6 Linux server, and ran into a small issue. Typically when I install java on linux I use the RPM packages, this allows you to run multiple versions of Java incase you need to roll back to a prior version. They have always worked flawless for me, until today. I typically install the rpm like so:

rpm -ivh jdk-7u17-linux-x64.rpm

But doing that yielded an error:

file /etc/init.d/jexec from install of jdk-2000:1.7.0_17-fcs.x86_64 conflicts with file from package jdk-2000:1.6.0_37-fcs.x86_64

So you can't have both 1.6 and 1.7 installed at the same time using the java RPM installers.

The solution is to run the rpm command with the -U flag instead of the -i flag (to upgrade instead of install). Make sure you stop all processes using Java (eg ColdFusion, etc) first, then run:

rpm -Uvh jdk-7u17-linux-x64.rpm


Related Entries

1 person found this page useful, what do you think?

Comments

Thanks for the tip. Worked like a charm.

Post a Comment




  



Spell Checker by Foundeo

Recent Entries



foundeo


did you hack my cf?