Uninstall OpenJDK in Ubuntu

Hirosh Tharaka
1 min readJun 3, 2019

--

Though the Ubuntu environments comes with OpenJDK, You have the authority to remove the OpenJDK and Install OracelJDK based on your requirement. Follow the steps below;

Remove OpenJDK,
execute the following command on terminal:
$ sudo apt-get remove openjdk*

Remove OpenJDK along with dependencies,
execute the following command on terminal:
$ sudo apt-get remove --auto-remove openjdk*

Remove OpenJDK and it’s configuration files,
xecute the following command on terminal:
$ sudo apt-get purge openjdk*

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 OpenJDK.

Verify the uninstall by executing the following in the terminal
(Restart, if required)
$ java -version

--

--

Hirosh Tharaka
Hirosh Tharaka

Written by Hirosh Tharaka

BSc(Hons), CSM®, ISTQB® (CTFL, CTAL-TTA, CTAL-TM) | Technical Writer | Technical Tester (QA Lead)

Responses (2)