As a programmer I use java for learning to code in Netbeans. I installed Sun java 6 long time ago over openJDK that came with my ubuntu just cause it seemed more responsive...

Now that oracle left the repos I wanted something easy to handle to install and uninstall, so I want to Remove completely sun java 6 from my computer and set as default OPENjdk....and openjre.

I already have installed OpenJDK and OPENjre...but not marked as default.

Besides I want to clean Sun java from here, dont wanna get messy ^^.

Running ubuntu 11.10


In terminal try the following commands:

$ sudo apt-get purge sun-java6-jre:amd64 sun-java6-jre:i386
$ sudo apt-get install openjdk-6-jre
  • 1
    gives me a virtual packages like sun-java6-jre cannot be removed – Tom Oct 16 '12 at 10:44

Not quite sure what the package names are (investigate using Synaptic), but something along the lines of:

apt-get purge sun-java6-jre
apt-get install openjdk-6-jre

should do the trick. apt should take care of all the configurating and resetting the default java to openjdk.

  • getting this on both commands:sudo apt-get purge sun-java6-jre Reading package lists... Done Building dependency tree Reading state information... Done Virtual packages like 'sun-java6-jre' can't be removed ...tried already that earlier but no luck :/... – Adel Ramadan Feb 9 '12 at 9:13
  • sun-java6-jre depends: sun-java6-bin, suggests: sun-java6-fonts, sun-java6-plugin. Have you tried removing those separately? – Li-aung Yip Feb 9 '12 at 12:00
  • No luck gettint this on "bin" and "plugin": "Unable to locate package" and in "fonts": unable to remove package. What I really dont get is this. When I go to check Java version says I got Java 6 23 and offers me to upgrade to version 6 30. But I have OPENJDK 7 and OPENJDK 6 installed...if I remove those I ahve to say goodbay to Jdownloader, so Im guessing I have OpenJDK installed but SUNJAVA is default on my system..(At least in firefox or network applets)... really dont know what to do wanna delete SUNJAVA!!!! damn XD – Adel Ramadan Feb 10 '12 at 16:17
  • Just to check, what do you get when you run java -version? I get ` lws@helios:~$ java -version java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30-b12) Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)` – Li-aung Yip Feb 10 '12 at 19:32

Your Answer

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

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