- Как удалить версию Java из Ubuntu 15.10?
- 1 ответ
- Как полностью удалить Java?
- How To Uninstall JDK From Linux ?
- Uninstall Oracle JDK
- Uninstall Openjdk
- AkbarAhmed.com
- Engineering Leadership
- Uninstall Java from Ubuntu Linux
- Introduction
- Uninstall Java
- Uninstall OpenJDK (if installed)
- How to Uninstall (Oracle Java & openJDK) in Linux
- Why should we remove Java?
- 1) Checking current version of Java
- 2) Check if you have installed any other Java version
- 3) Checking Java installation method
- 3.a) Checking Java installation method on Debian/Ubuntu
- 3.b) Checking Java installation method on RPM based systems
- 4) Removing Java in Linux
- 4.a) Removing Java in Debian/Ubuntu
- 4.b) Removing Java in RPM based system
- 4.c) Uninstalling Oracle Java
- 5) Checking Java version
- Closing Notes
- Related Posts
- How to install Oracle Java (JDK/JRE) 8/11/12 in Linux?
- How to Enable Java plugin support on Firefox on Linux
- How To Install Oracle Java 7, 8 & 9 (JDK & JRE) on Debian Via Repository
- About Magesh Maruthamuthu
- 17 Comments on “How to Uninstall (Oracle Java & openJDK) in Linux”
Как удалить версию 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 были удалены.
Источник
Как полностью удалить 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 JDK From Linux ?
This tutorial is written to help New Linux Users, who want to uninstall Java Development Kit (JDK) installed on their Linux. The tasks performed on Ubuntu 16.04, but this will also work on other Debian Based Linux like Linux Mint, Kali Linux, etc.
So, first of all, check the vendor of the JDK you have installed on your system, whether it is Oracle JDK or Openjdk. For that execute the following command in the terminal:
$ java -version
If you have Oracle JDK installed then you will get the following result:
Else if you have Openjdk installed then you will get the following result:
Now follow the instructions below according to the JDK you have installed.
Uninstall Oracle JDK
Remove The Link
First of all remove the alternatives by executing the following commands:
- $ 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]/jre/bin/javaws»
Note: Replace the [version] with any version number that’s contained in jdk folder’s name. For example: jdk1.8.0_131 .
Remove The Package
After removing link, remove the package inside /usr/lib/jvm/jdk[version] by executing following command:
$ sudo rm -r /usr/lib/jvm/jdk[version]
Uninstall Openjdk
If you want to remove Openjdk only, execute the following command on terminal:
$ sudo apt-get remove openjdk*
If you want to remove Openjdk along with dependencies, execute the following command on terminal:
$ sudo apt-get remove —auto-remove openjdk*
If you want to remove Openjdk and it’s configuration files, execute the following command on terminal:
$ sudo apt-get purge openjdk*
If you want to remove Openjdk along with dependencies and it’s configuration files, execute the following command on terminal:
$ sudo apt-get purge —auto-remove openjdk*
This is how you can uninstall JDK. Share this, if it is helpful to you and please report us if you found and error in this post. Thank you.
Источник
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.
Источник
How to Uninstall (Oracle Java & openJDK) in Linux
Most of us believe that uninstalling Java is a difficult task in Linux, but it’s not as per my opinion, because I have installed Java on various distributions several times and removed it safely without any problems.
To do so, you need to check few things before removing JAVA.
In general, people install ‘Oracle Java’ or ‘openJDK’ depending on their need.
In this guide, we will show you how to uninstall/remove Java in Linux. By looking at the steps below, you will realize how easy it is.
Why should we remove Java?
You may need to uninstall Java from your system for below common reasons:
- You may need to install latest version due to application compatibility.
- You no longer need Java on your system
Refer the below link for installing Java on various Linux distributions.
1) Checking current version of Java
Installed Java version in Linux system can be verified using the following command. The below output shows that we have Oracle Java version “1.7.0_72” :
2) Check if you have installed any other Java version
For various reasons, some users might have installed multiple Java versions which can all be listed together using the ‘update-alternatives’ command as shown below.
As per the following output, we have installed three Java versions and ‘Oracle Java 7’ is the one that’s currently active on the system:
3) Checking Java installation method
Before uninstalling Java, you should find how Java was installed in the system. It could be installed using one of the below methods:
- Manual method
- From the rpm file
- Distribution repository or Third-party repository
As stated in the beginning of the article, user would have installed Oracle Java or openJDK.
- OpenJDK : Everybody uses distribution official repository to install openJDK.
- Oracle JAVA : User might use one of these methods viz. Manual or Third-party repository or RPM file.
3.a) Checking Java installation method on Debian/Ubuntu
Use the below commands to check how JAVA was installed on an Ubuntu/Debian system. As per the below output, “OpenJDK 1.7.0_65” has been installed from the Ubuntu repository:
Feel free to double check whether “OpenJDK 1.7.0_65” was installed from the Ubuntu repository by running the below command, which in our case shows that it was installed from the Ubuntu official repository as shown below:
As per the below output, “Oracle Java 7” has been installed from third-party repository, namely «webupd8» :
Also, we can see that “Oracle JAVA 8” was installed using the manual method, as it is located under the ‘/opt’ directory, see below:
3.b) Checking Java installation method on RPM based systems
Use the below commands to find out how JAVA was installed on RPM based systems, such as RHEL, CentOS, Fedora and openSUSE. The following output shows that, “OpenJDK 1.7.0_71” was installed using the CentOS repository:
You can double check the above result by running the below command:
Also, the “Oracle Java 8” was installed manually using the RPM file as per the following output, because it doesn’t show the distribution version which was shown in the previous output:
4) Removing Java in Linux
Now that we have understood how to find out the installation method of JAVA on a Linux system, let’s proceed to understand how to remove/uninstall JAVA.
Uninstalling Oracle Java or openJDK can be done in multiple ways and you can use a suitable method as you see fit. This section summarizes some of those methods.
4.a) Removing Java in Debian/Ubuntu
You may need to run these commands based on section ‘3.a’ to uninstall ‘Oracle Java’ or ‘OpenJDK’ in Ubuntu/Debian systems:
4.b) Removing Java in RPM based system
You may need to run these commands based on section ‘3.b’ to uninstall ‘Oracle Java’ or ‘OpenJDK’ in Red Hat, CentOS, Fedora and openSUSE systems:
4.c) Uninstalling Oracle Java
Alternatively, Oracle Java can be removed from the Linux system using the ‘update-alternatives’ command as shown below.
(replace the word (version)with your Java version. DO java -version to get yours. So if your version is 1.8.0-92, you would type sudo update-alternatives –remove “java” “/usr/lib/jvm/jdk1.8.0-92/bin/java”)
Now, remove the corresponding JDK folder by executing the following command:
5) Checking Java version
At this stage, we have completely removed openJDK & Oracle Java from our system. If no Java version is installed on the system, you will get the following message:
Closing Notes
In this article, you learnt how to install ‘Oracle Java’ or ‘OpenJDK’ in various Linux distributions such as Ubuntu, Debian, RHEL, Fedora, CentOS and openSUSE.
If you found this article helpful, please do share with your friends and spread the knowledge. Please feel free to comment below if you have any queries/concerns. We will get back to you as soon as we can. Happy learning!
Related Posts
How to install Oracle Java (JDK/JRE) 8/11/12 in Linux?
October 25, 2017 January 16, 2020
How to Enable Java plugin support on Firefox on Linux
March 17, 2016 April 25, 2016
How To Install Oracle Java 7, 8 & 9 (JDK & JRE) on Debian Via Repository
February 9, 2016 February 8, 2016
About Magesh Maruthamuthu
Love to play with all Linux distribution
17 Comments on “How to Uninstall (Oracle Java & openJDK) in Linux”
im on kalilinux 2020.4 i installed java 11.0.9 and java jdk 8 u217
when i write java -version
lzh:permission denied java
it’s not about root there is another errorr help me plz
Can you share with us en exact error message that you are getting to understand more about it?
I see you don’t monetize your website, i think there is one opportunity to earn additional cash on your page,
search in google for: idol4jp makes money
Hi Magesh,
Please see my post here. How do I remove Java 7?
# java -version
If ‘java’ is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf java
linux-bi4s:
# update-alternatives –config java
update-alternatives: error: no alternatives for java
linux-bi4s:
# rpm -qa | grep java
timezone-java-2014h-1.1.noarch
java-1_7_0-openjdk-1.7.0.71-1.1.x86_64
libjavascriptcoregtk-1_0-0-2.4.6-1.4.x86_64
java-1_7_0-openjdk-headless-1.7.0.71-1.1.x86_64
libjavascriptcoregtk-3_0-0-2.4.6-1.4.x86_64
libjavascriptcoregtk-4_0-18-2.6.1-1.1.x86_64
java-binfmt-misc-1.4-4.1.3.x86_64
linux-bi4s:
# rpm -qa | grep jdk
java-1_7_0-openjdk-1.7.0.71-1.1.x86_64
java-1_7_0-openjdk-headless-1.7.0.71-1.1.x86_64
linux-bi4s:
# rpm -e java-1_7_0-openjdk-1.7.0.71-1.1.x86_64
error: Failed dependencies:
jre-64 > 1.5 is needed by (installed) libreoffice-writer-extensions-4.3.2.2-1.3.x86_64
jre-64 > 1.5 is needed by (installed) libreoffice-calc-extensions-4.3.2.2-1.3.x86_64
linux-bi4s:
Источник