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 :: linux permission denied jupyter notebook 
Shell :: ubuntu zip folder 
Shell :: install antigen mac 
Shell :: install package from conda forge not found in conda 
Shell :: unzip a .gz file in linux 
Shell :: mounting nvme disk on aws ec2 
Shell :: docker purge all 
Shell :: bastighg 
Shell :: use x2go with gnome linux 
Shell :: how to kwno if my mac has intel 32 or 64 
Shell :: chalk Error [ERR_REQUIRE_ESM]: require() of ES Module 
Shell :: ubuntu apt uninstall 
Shell :: nmap os and version detection 
Shell :: zsh profile 
Shell :: ubuntu install latest node with nvm 
Shell :: get current kernel version 
Shell :: search by service terminal 
Shell :: kill apache Failed to restart apache: [apache] 
Shell :: redis start stop commands 
Shell :: angular cli install ubuntu 
Shell :: untar tar.gz 
Shell :: git reset change in one file 
Shell :: github see the username 
Shell :: git remoev .DS_Store 
Shell :: open local files wsl 
Shell :: arch console set default keyboard layout 
Shell :: hstr editor 
Shell :: git stash command with name 
Shell :: fsl flirt 
Shell :: xrandr 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =