Removing all traces of GNU java and openjdk and replacing with Sun JDK
- by user61766
I have installed latest Sun JDk. But when I do:
java -version
I still got OpenJDK version.
So I completely removed OpenJDK. But now when I do:
java -version
I get even older GNU java 1.5 something libgcj. So I completely removed that too but it was asking to remove bunch of dependent apps like OpenOffice.org Writer etc. Even though I need the writer, I let it go because I do not want ever to see the face of any GNU java on my linux. So everything related to GNU java is removed. Luckily I am able to start Eclipse and it works fine and start normally (apparently using the installed Sun JDK which is what I want). But now when I run
java -version
I get bash: /usr/bin/java: No such file or directory
Now what I need to do so that when I open any terminal window and enter java -version
I should get Sun JDK version? Sun JDK is installed in /usr/java/jdk1.6.021. I also have symlinks: /usr/java/latest and /usr/java/defaults pointing to sun jdk.