Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i encounter a very strange problem,and here is the detail: i'm going to uninstall the jdk 1.7.0.but when i use the rpm to check the appropriate name of the package,it prompt nothing.Anyway,when i use the command java -version,it will prompt the detail of the jdk 1.7.0. below is the detail:

root@kaiwiiho:/usr/java# rpm -qa|grep jdk
root@kaiwiiho:/usr/java# java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)
root@kaiwiiho:/usr/java# rpm -qa|grep jdk

so what happen?And how can i uninstall it?thx

share|improve this question

migrated from Mar 31 '12 at 16:35

This question came from our site for professional and enthusiast programmers.

This is off-topic. I recommend the "superusers" sister site for this kind of question. – Stephen C Mar 31 '12 at 2:12
ubuntu doesn't use rpm? – dotjoe Mar 31 '12 at 2:19
voted for superuser...write in for – dotjoe Mar 31 '12 at 2:27
rpm packages are for Red Hat / Fedora-based Linux distributions. Debian-based Linux distributions such as Ubuntu use a different package format (deb). – Jesper Mar 31 '12 at 6:34
up vote 1 down vote accepted

On Ubuntu? The process would be

$ dpkg -l | grep jdk

Then remove with

$ apt-get purge <packagename>

If you're brave, you could

$ apt-get purge $(dpkg -l | grep jdk | awk '{print $2}')

(It should still prompt you, though.)

share|improve this answer
root@kaiwiiho:/usr/java# dpkg -l | grep jdk ii gcj-4.5-jdk 4.5.2-8ubuntu1 gcj and classpath development tools for Java(TM) ii gcj-jdk 4:4.5.2-1ubuntu3 gcj and classpath development tools for Java(TM) ii sun-java6-jdk 6.26-2lucid1 Sun Java(TM) Development Kit (JDK) 6 it seems nothing about jdk 1.7.did i do something wrong,when i installed the jdk 1.7? – kaiwii ho Mar 31 '12 at 2:18
Java HotSpot(TM) Server VM sounds like the Sun Java implementation. Those packages are named sun-java*. grep for "sun-java" instead: dpkg -l | grep sun-java – brmiller Mar 31 '12 at 2:33
You can also find out what's what using update-alternatives --display java. That should give a hint as to which package is providing "java". – brmiller Mar 31 '12 at 2:41
well,i try it.but i feel confused there is nothing about 1.7.0 about 1.6 – kaiwii ho Mar 31 '12 at 2:52
don't forget on ubuntu, you don't login as root, so you'll have to prepend "sudo" to the commands you are executing which actualy remove the package (ie. the apt-get) – Matt Mar 31 '12 at 3:51

You must log in to answer this question.