I have this package of java jdk-7u3-linux-x64.rpm. So I have been doing this normally yum install jdk-7u3-linux-x64.rpm. Then immediately I will do this
alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000
alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000
alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
Next step is this alternatives --config java and pick the latest one. Suddenly this particular machine I am having issue when I run this 2 commands it shows me different version of java and javac causing my programme can't be compiled.
Below is all the java
alternatives --config java
There are 4 programs which provide 'java'.
Selection Command
-----------------------------------------------
* 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
3 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
+ 4 /usr/java/latest/jre/bin/java
Enter to keep the current selection[+], or type selection number:
Java version is as below
java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
But my javac -version is
javac -version
javac 1.7.0_19
I am very surprised -- where does the 1.7.0_19 come from, because my installation version is just 1.7.0_03?
Any idea how to resolve this?