Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

How To Uninstall JDK From Linux

>>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:

	anshuman@developer:~$ java -version
	java version "1.8.0_112"
	Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
	Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
	Else if you have Openjdk installed then you will get the following result:

	anshuman@developer:~$ java -version
	java version "1.7.0_91"
	OpenJDK Runtime Environment (amzn-2.6.2.2.63.amzn1-x86_64 u91-b00)
	OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
	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.
Comment

PREVIOUS NEXT
Code Example
Shell :: obs uninstall ubuntu 
Shell :: ERROR:uvicorn.error:[Errno 98] Address already in use 
Shell :: disable ubuntu firewall 
Shell :: nginx control process exited with error code 
Shell :: linux install pip 
Shell :: shutdown pc in 10 minutes 
Shell :: dos2unix recursive folder 
Shell :: Syntax Error: TypeError: this.getOptions is not a function 
Shell :: install ansible on ubuntu 18.04 
Shell :: linux check if a port is open 
Shell :: how to remove base from command prompt 
Shell :: regex for ips 
Shell :: Create React App requires Node 14 or higher. 
Shell :: bash script create file if not exist 
Shell :: gcloud get projects 
Shell :: install neovim 0.5 ubuntu 
Shell :: how to uninstall pycharm community edition in ubutu 
Shell :: run msi on linux 
Shell :: git asking for password every time 
Shell :: installing gnome tweak tool 
Shell :: ubuntu clean up disk space 
Shell :: appcenter cli 
Shell :: instal screen di linux 
Shell :: mac install gpg 
Shell :: unzip centos 
Shell :: get docker id from name 
Shell :: install kazam ubuntu 20.04 
Shell :: linux terminal check internet connection 
Shell :: git rm cached gitignore 
Shell :: bootstrap install for next.js 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =