how to remove default-jre java installation from U

2020-06-17 04:23发布

I had no java (i.e. java -version said java no found or similar)

I installed it like this:

sudo apt-get install default-jre

This results in installing java 1.6 - I need java 1.7

So the next probelem is how to uninstall it.

I tried this:

sudo apt-get --purge -remove default-jre

Which seemed to work, but when I do:

java -version

I still java respond with 1.6 - i.e. id didnt uninstall java.

Ok, so I guess -remove does not remove the thing it installed. Is there a way to o this?

4条回答
地球回转人心会变
2楼-- · 2020-06-17 04:53

To completely remove jdk from your system, follow these below steps:

  1. Type sudo apt-get autoremove default-jdk openjdk- (Don't hit Enter right now).
  2. Now press tab button for 2 or 3 times, you will get list of packages starting with openjdk-.
  3. Look for name like openjdk-11-jdk. You need to get java version, here is 11.
  4. Now complete your command to sudo apt-get autoremove default-jdk openjdk-11-jdk. (Change 11 to your java version)
  5. And Hit Enter button.

Now you have done removing java from your system.

查看更多
成全新的幸福
3楼-- · 2020-06-17 05:03

Bary12's answer worked for me:

sudo apt-get autoremove default-jre

查看更多
▲ chillily
4楼-- · 2020-06-17 05:16

You can remove Java 12 using this command--

sudo apt-get remove oracle-java12-installer

you can change the version by changing the 12 to the version present on your computer

then recheck by finding version -

java -version
查看更多
三岁会撩人
5楼-- · 2020-06-17 05:17
sudo apt-get remove default-jre

removes the package "default-jre". all tho you should ask in askUbuntu

查看更多
登录 后发表回答