2
1
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.
As suggested in the answer, I tried the alternatives command but it did nothing. I type the --display, nothing is shown, and --config does nothing.
Why are you trying to get rid of GNU Java? – Sophie Alpert – 2011-03-20T18:14:26.510
@Ben: I'm trying to do the same thing. Primarily cause PhpStorm claims to be having issues with it. I don't care whether it does or not, at this point -- what's the deal with having to rip out half the system to get rid of it? What is this, Windows? – cHao – 2012-04-16T17:41:51.797