To verify that the installation was successful, execute
java -version
The output should look something like this if everything is well
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)
If the version does not match what you just installed then you might have JRE/JDK installed previously
Multiple JRE/JDK installed If you have multiple JRE or JDK installed (e.g. 1.5.0 and 1.4.2) and want/need to switch between them, you can use update-alternatives to do so.
Example: Choosing which java executable to use:
update-alternatives --config java
Example: Choosing which javac executable to use:
update-alternatives --config javac
And so on in that fashion for the remaining executables related to Java. You can look in /etc/alternatives to see what one can configure with update-alternatives.
Links : Download