first type alternatives --config java
alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_26/jre/bin/java 3
alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_26/bin/javac 3
alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.7.0-openjdk/bin/java
2 /usr/java/jdk1.6.0_26/jre/bin/java
Enter to keep the current selection[+], or type selection number: 2
[root@iQuny bin]# alternatives --config javac
There are 2 programs which provide 'javac'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.7.0-openjdk/bin/javac
2 /usr/java/jdk1.6.0_26/bin/javac
Enter to keep the current selection[+], or type selection number: 2
[root@iQuny bin]# java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)
got it!