Uninstall OpenJDK in Ubuntu

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

To install the OracleJDK refer:
Install Oracle JDK 1.8 and Set environment variables in Ubuntu

Writer | Vlogger | Techie | Technical Tester (Snr-QAE)

Love podcasts or audiobooks? Learn on the go with our new app.