Friday, December 6, 2013

Registering Oracle Java using alternatives on CentOS 6

If you want to add the Oracle JDK to a CentOS 6 box, one easy way is to download the JDK RPM package, and use the rpm(8) command to install it easily, like this:

$ sudo rpm -ivh jdk-7u45-linux-i586.rpm

But chances are the newly installed JDK will not be visible at the command line, especially if the openjdk is already present. How to fix this? You'll have to use the alternatives(8) command to manually register the Oracle JDK. See the instructions on the if-not-true-then-false site for details. I recommend following the "Use Java JDK latest version" example.

No comments:

Post a Comment