I installed oracle jdk on ubuntu 14.04. Now I want to toggle back to openjdk:
sudo update-alternatives --config java
sudo update-alternatives --config javac
But it doesn't work. It seems oracle's jdk somehow keeps adding itself to my $PATH:
...:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:...
I've found and killed /etc/profile.d/jdk.csh, but there seems to be a failsafe. The audacity!!
How can I fix this?
jdk.shin that same location, did you kill that too? – George Udosen Mar 20 '17 at 19:56sudo update-alternatives --remove "java" "/usr/lib/jvm/jdk[version]/bin/java"– George Udosen Mar 20 '17 at 23:31update-alternativeswas designed for this. – jozxyqk Mar 21 '17 at 02:09sudo update-alternatives --config javashould have shown the the three then you pick from there... – George Udosen Mar 21 '17 at 05:58update-alternativescommands. It doesn't work, because that seems to use symlinks but oracle's jdk is overriding my PATH which takes priority. I don't know how the values are being added to PATH and am hoping someone here can point me in the right direction. – jozxyqk Mar 21 '17 at 22:43