How do I stop oracle JDK from hijacking PATH and breaking update-alternatives?

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?

9

1 Answer

I think you are on the right track by removing /etc/profile.d/jdk.csh and /etc/profile.d/jdk.sh. You just have to re-login or reboot so that the PATH changes have effect.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like