- AkbarAhmed.com
- Engineering Leadership
- Uninstall Java from Ubuntu Linux
- Introduction
- Uninstall Java
- Uninstall OpenJDK (if installed)
- Как полностью удалить Java?
- How to uninstall Java from Ubuntu
- How to check the type of Java on Linux (Ubuntu):
- How to identify the Java version on Linux (Ubuntu):
- How to switch versions of Java on Linux (Ubuntu):
- How to check the installation method of Java on Linux (Ubuntu):
- How to uninstall Java from Linux (Ubuntu):
- Linux Mint Forums
- Howto remove Java?
- Howto remove Java?
- Re: Howto remove Java?
- Re: Howto remove Java?
- Как удалить версию Java из Ubuntu 15.10?
- 1 ответ
AkbarAhmed.com
Engineering Leadership
Uninstall Java from Ubuntu Linux
Introduction
Hopefully you won’t need these instructions due to a botched install, but there may come a time where you need to uninstall a version of the JDK/JVM.
These instructions are for the Oracle JDK 1.7.0 Update 4 on Ubuntu 12.04 LTS. If you are using a different version of the JDK, then change the version numbers listed below.
I have also included instructions for removing the OpenJDK at the bottom of this post.
Uninstall Java
Let’s check the current setup before we uninstall Java.
The output from the command will be something like:
java — manual mode
link currently points to /usr/lib/jdk1.7.0_04/bin/java
/usr/lib/jdk1.7.0_04/bin/java — priority 1
/usr/lib/jvm/j2sdk1.6-oracle/jre/bin/java — priority 315
slave java.1.gz: /usr/lib/jvm/j2sdk1.6-oracle/man/man1/java.1.gz
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java — priority 1051
slave java.1.gz: /usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/java.1.gz
Current ‘best’ version is ‘/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java’.
Next, we’ll remove each symlink to a Java binary from the Debian alternatives system. I have split the following commands onto multiple lines to ensure that they display correctly on this page. However, you can remove the \ and then type each command on one line in the terminal.
Let’s quickly verify that the commands above remove the symlinks.
You should no longer see 1.7.0 u04 for the version of any of the above commands.
IMPORTANT WARNING
You must type the next 2 commands perfectly to avoid permanently destroying your system. If you do this wrong, you could delete important system files, including those that are required by Ubuntu.
Output:
update-alternatives: error: no alternatives for java.
Output:
update-alternatives: error: no alternatives for javac.
Output:
update-alternatives: error: no alternatives for javaws.
Delete the line with JAVA_HOME
Uninstall OpenJDK (if installed)
First we’ll check which OpenJDK packages are installed.
Next, let’s uninstall OpenJDK related packages. Edit the list of packages below if you have additional or different OpenJDK packages installed.
Let’s check that all OpenJDK packages have been removed.
Источник
Как полностью удалить Java?
Как я могу полностью удалить все следы Java в моей системе?
Я уже знаю, как установить его на случай, если он мне понадобится снова.
Удалите все связанные с Java пакеты (Sun, Oracle, OpenJDK, плагины IcedTea, GIJ):
Очистить файлы конфигурации (осторожно. Эта команда также удалила файлы конфигурации libsgutils2-2 и virtualbox):
Удалить конфигурацию Java и каталог кеша:
Удалить установленные вручную JVM:
Удалите записи Java, если они еще есть, из альтернатив :
Поиск возможных оставшихся каталогов Java:
Если команда выше производит какой — либо вывод , как /path/to/jre1.6.0_34/bin/pack200 удалить каталог , который является родителем бина , как это: sudo rm -rf /path/to/jre1.6.0_34 .
Чтобы полностью удалить OpenJDK в Ubuntu 11.10 (этого может и не хватить в других версиях Ubuntu), выполните:
Если вы хотите получить инструкции по удалению проприетарной версии Java («Sun») для Oracle, вам нужно будет указать, как вы ее установили. (Если вы измените свой вопрос, чтобы указать это, и оставите комментарий к этому ответу, я постараюсь добавить информацию о том, как его удалить.)
Вам может не потребоваться полностью удалить OpenJDK для решения вашей проблемы. Установите пакеты sun-java6. Затем используйте update-java-alternatives для переключения на Java-пакеты Sun.
Если вы хотите полностью удалить OpenJDK, удалите пакеты default-jdk и / или default-jre. Возможно, вам придется удалить некоторые java-пакеты, но большинство из них должны быть счастливы, когда у вас установлены пакеты Sun JDK.
Возможно, вы захотите следовать одному из этих советов по очистке, как только вы закончите удаление пакетов.
Чтобы удалить Oracle Java 7, просто нажмите Ctrl + Alt + T на клавиатуре, чтобы открыть терминал. Когда он откроется, выполните команду ниже.
Чтобы проверить настройки перед удалением Java.
Затем удалите символические ссылки
(замените слово (версия) на вашу версию Java. java -version Делайте, чтобы получить свою. Поэтому, если ваша версия 1.7.0_03, вы бы сделали type sudo update-alternatives —remove «java» «/usr/lib/jvm/jdk1.7.0_03/bin/java» )
убедитесь, что символические ссылки были удалены
Следующие 2 команды должны быть набраны безупречно во избежание полного разрушения вашей системы .
Удалить строку с JAVA_HOME 1
Удалить OpenJDK (если установлен). Сначала проверьте, какие пакеты OpenJDK установлены.
Чтобы удалить openjdk:
Удалите пакеты, связанные с OpenJDK.
Убедитесь, что все пакеты OpenJDK были удалены.
Источник
How to uninstall Java from Ubuntu
In many cases, you may need to remove java from your computer, such as installing the latest version of java or freeing up space from your machine. Installing Java on Ubuntu is pretty straightforward, but uninstalling it is a hard nut to crack for many folks. In this guide, we will learn how many versions of java are there, what distinguishes them, and how to erase them from your computer completely.
How to check the type of Java on Linux (Ubuntu):
Before erasing java from your device, the first check is to identify what type of java you have on your PC. If you have installed java just to run the java applications, it would most probably “Java Runtime Environment (JRE).” Or, if you have installed java for development purpose, then you may have one of the following:
The difference between “Open JDK” and “Oracle Java” is that the former is open-source, whereas the latter is license-based. Oracle Java is much better when it comes to performance and stability.
How to identify the Java version on Linux (Ubuntu):
Before uninstalling java from your PC, it is essential to know which version of java you have got. To check it launch terminal by pressing “ctrl+alt+t” and type the below-mentioned command:
The above command will also indicate whether the version of java is “Open JDK” or “Oracle JDK.”
Standard output if the version is “OpenJDK”:
Standard output if the version is “Oracle Java”:
If you don’t have any version of java on your machine, the standard output will display it and provide some commands to install it.
How to switch versions of Java on Linux (Ubuntu):
Interestingly, you can have more than one versions of java on your device, and you can check and switch any of them by using the command mentioned below:
The above command is displaying the different versions of java I have on my PC. To switch, simply type the number and press “Enter.”
How to check the installation method of Java on Linux (Ubuntu):
In some cases, it is crucial to identify the method of installation of java. To check it, use the command:
For oracle java use:
The above output will indicate whether the package is installed from an official repository or a third-party repository. The above screenshots are demonstrating that “Oracle Java” is installed using the third-party repository “Linux pricing,” whereas “OpenJDK” is installed using the official Ubuntu repository.
How to uninstall Java from Linux (Ubuntu):
In the above discussion, we learned that there are multiple versions of java; you can have all of them on your PC at a time and conveniently switch them. Various approaches can be used to delete java from ubuntu. To completely erase “OpenJDK,” use:
Источник
Linux Mint Forums
Welcome to the Linux Mint forums!
Howto remove Java?
Howto remove Java?
Post by McCleod48 » Mon Dec 17, 2012 3:47 am
I’ve found Mint as a proper replacement for Ubuntu but I hit a setback in my effort to optimize the system.
My test-install is a Mint 13 MATE 32-bit (it’s on my travelling-stick).
I’m trying to get rid of Java as I have absolutely no need for it what-so-ever. But I can’t. If I remove the installed Java-support another Java-support gets installed in it’s place. And if I remove that I get another one instead. Why can’t I remove Java?
Re: Howto remove Java?
Post by xenopeek » Mon Dec 17, 2012 5:38 am
Because you have applications installed that require Java (like LibreOffice, which is a Java application). So if you uninstall it, the package manager will detect you would end up with a broken system and so installs another package to satisfy the dependencies.
I guess your concern would be mostly about Java in your browser, from security standpoint? You can easily remove Java from your browser with the following command:
Re: Howto remove Java?
Post by McCleod48 » Mon Dec 17, 2012 5:58 am
xenopeek wrote: Because you have applications installed that require Java (like LibreOffice, which is a Java application). So if you uninstall it, the package manager will detect you would end up with a broken system and so installs another package to satisfy the dependencies.
I guess your concern would be mostly about Java in your browser, from security standpoint? You can easily remove Java from your browser with the following command:
I have removed LibreOffice. I do not use office-suites. And still I can’t get rid of Java.
My concern is to remove every software package that I do not need and I do not need Java. I have been running Ubuntu for 5+ years without Java. I really do not need it.
Источник
Как удалить версию Java из Ubuntu 15.10?
Несколько месяцев назад я установил на своем компьютере версию java. К сожалению, я не помню как.:(
Теперь каждый раз, когда я бегу sudo apt-get upgrade или же update или же autoremove Я получаю следующие сообщения:
Я только что попытался обновить Ubuntu 16 из командной строки, но это не удалось. Поэтому мне действительно нужно удалить чертову штуку, но ни одна из прочитанных мной постов не помогла мне! Что я должен сделать, чтобы избавиться от этой установки Java (и, возможно, затем установить ее правильно)?
1 ответ
Чтобы удалить Oracle Java 8, просто нажмите Ctrl+Alt+T на клавиатуре, чтобы открыть терминал. Когда он откроется, выполните команду ниже.
Чтобы проверить настройки перед удалением Java. Затем удалите символические ссылки
(замените слово (версия) на вашу версию Java. Сделайте java -version, чтобы получить вашу. Поэтому, если ваша версия 1.8.0-92, вы должны ввести sudo update-alternatives —remove «java» «/ usr / lib / jvm / jdk1.8.0-92 / bin / java «)
убедитесь, что символические ссылки были удалены
Следующие команды следует вводить с осторожностью, чтобы избежать необратимого разрушения вашей системы.
Теперь отредактируйте переменные среды.
Удалите строки с помощью JAVA_HOME, JRE_HOME, если есть
Удалить OpenJDK (если установлен). Сначала проверьте, какие пакеты OpenJDK установлены.
Чтобы удалить openjdk:
Удалите пакеты, связанные с OpenJDK.
Убедитесь, что все пакеты OpenJDK были удалены.
Источник