How to remove Oracle JDK
Solution 1
It could be done like this:
Remove the link:
sudo update-alternatives --remove "java" "/usr/lib/jvm/jdk[version]/bin/java" sudo update-alternatives --remove "javac" "/usr/lib/jvm/jdk[version]/bin/javac" sudo update-alternatives --remove "javaws" "/usr/lib/jvm/jdk[version]/bin/javaws"
Then, remove the package in the
/usr/lib/jvm
:sudo rm -r /usr/lib/jvm/jdk[version]
Note :
Change [version] with any version number that's contained in jdk folder's name, example:
jdk[version] = jdk1.7.0_13
.If you are new to Linux, you should probably get familiar with the manual page. Lot of good stuff from there. Just go to the terminal and type
man update-alternatives
.
Solution 2
Run sudo update-alternatives --config java
and choose an openjdk verion. Delete the oracle jdk files and if you need to uninstall openjdk too, do it with the Ubuntu Software Center.
Solution 3
Delete the symlinks in bin and wherever you extracted the tarball(it SHOULD be in opt, but i didn't read the previous guide)
Related videos on Youtube
Comments
-
obysr almost 2 years
I didn't find any related articles about How to remove Oracle JDK. There are some related articles but they didn't solve the problem.
I installed Oracle JDK tarball file from Oracle site by following this article How do I install Oracle Java JDK 7. It was very helpful. But still I don't know what I should do in order to uninstall Oracle JDK.
-
obysr about 12 yearshow about symlinks? will it become trash link? how should i do to purge remove all settings and configuration from Oracle JDK?
-
obysr about 12 yearswhat are the steps? i need them. could you explain them all?
-
Patrick Flynn about 12 yearsapt-get purge will allow you to clean up packages completely
-
obysr about 12 yearsjust write that? or any shell commands i have to write?
-
Patrick Flynn about 12 yearsThese links point to the chosen Java: /usr/bin/java -> /etc/alternatives/java and /usr/bin/javac -> /etc/alternatives/javac
-
obysr about 12 yearsthank you sir but i don't understand what you write. actually, i'm newbie in linux. could you explain it? i'm very grateful for your help
-
Patrick Flynn about 12 yearsI would not worry too much about remaining configuration files that are left back after uninstalling packages. If you do, run "sudo apt-get install dctrl-tools". After installing dctrl-tools run grep-status in order to find the files and the dependencies.
-
obysr over 11 yearsGreat thanks, it works! but litle missing manual that must be writted in this case
-
Karl Morrison almost 8 yearsDoesn't work: askubuntu.com/questions/830244/…