Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I didn't find article any related articles 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 I don't what I should do to uninstall Oracle JDK.

share|improve this question

3 Answers 3

up vote 7 down vote accepted

This could be done like this:

  1. 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"

  2. 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 be familiar with the manual
    page. Lot of good stuff from there. Just go to the terminal and type "man update-alternatives"

share|improve this answer
    
Great thanks, it works! but litle missing manual that must be writted in this case –  obysr Feb 16 '13 at 22:34

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.

share|improve this answer
    
how about symlinks? will it become trash link? how should i do to purge remove all settings and configuration from Oracle JDK? –  obysr Mar 31 '12 at 6:41
    
apt-get purge will allow you to clean up packages completely –  Costis Aivalis Mar 31 '12 at 6:48
    
just write that? or any shell commands i have to write? –  obysr Mar 31 '12 at 6:49
    
These links point to the chosen Java: /usr/bin/java -> /etc/alternatives/java and /usr/bin/javac -> /etc/alternatives/javac –  Costis Aivalis Mar 31 '12 at 6:53
1  
thank 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 –  obysr Mar 31 '12 at 6:59

Delete the symlinks in bin and wherever you extracted the tarball(it SHOULD be in opt, but i didn't read the previous guide)

share|improve this answer
1  
what are the steps? i need them. could you explain them all? –  obysr Mar 31 '12 at 6:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.