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

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

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest