I am trying to installing on Centos java from Oracle. Following are my steps. yum install /usr/local/jdk-7u3-linux-x64.rpmalternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000alternatives --config java I pick the latest version here.The problem now only my java is pointing to the new version wheras the javac is not pointing to it below is how I trace for java and javac.Java  ls -la /usr/bin/java lrwxrwxrwx. 1 root root 22 May 22 13:09 /usr/bin/java -> /etc/alternatives/java ls -la /etc/alternatives/java lrwxrwxrwx. 1 root root 25 May 22 13:09 /etc/alternatives/java -> /usr/java/latest/bin/javaJavac ls -la /usr/bin/javac lrwxrwxrwx. 1 root root 23 May 22 11:37 /usr/bin/javac -> /etc/alternatives/javac ls -la /etc/alternatives/javac lrwxrwxrwx. 1 root root 48 May 22 11:37 /etc/alternatives/javac -> /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/javac Any solution to overcome this? I have tried previously on other machines on Centos 6.3 works fines. 
Alternatives not working well for Java installation on Centos 6.4
centos;java
See 'air-dex' example on this post:  https://askubuntu.com/questions/159575/how-do-i-make-java-default-to-a-manually-installed-jre-jdk .  Note: sometimes people install Java JDK's into '/usr/lib/jvm', and as you can see in the output on my blog post, the system came with default JVMs in this location, but personally I don't recommend that for a JDK.  Maybe I would choose '/usr/lib/jvm' if it was a JRE I was installing.  If you wanted an alternative location for JDKs and JREs, I would choose either:   1. /usr/java/   2. /opt/java/If I were comparing to windows, I might say:JDKs: /usr/java = C:\JavaJREs: /usr/lib/jvm = C:\Program Files\JavaAlt:  /opt/java = E:\Java