Pete Freitag Pete Freitag

Upgrading to Java 7 on Linux

Published on April 10, 2013
By Pete Freitag

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

java linux rpm

Upgrading to Java 7 on Linux was first published on April 10, 2013.

If you like reading about java, linux, or rpm then you might also like:

Weekly Security Advisories Email

Advisory Week is a new weekly email containing security advisories published by major software vendors (Adobe, Apple, Microsoft, etc).