Image for post
Image for post

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


Some of the environments or projects you work with may specifically need the Java8 (JDK-1.8) for the references. In such instances, the ideal solution is to download the jdk.tar.gz file from the oracle.com and install it from the terminal without depending to apt-get or any other.

The following is the step-by-step guide of how to install and set the environment-variable paths successfully.

Prerequisites:

Download the JavaSE Development Kit 8 from the given link below.
URL : https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (Linux x64 : jdk-8u211-linux-x64.tar.gz)

Image for post
Image for post

Download the above tar.gz file to “/home/hirosht/Downloads”.
(You might have to login to the Oracle Account to download)

Ps: If any other version of OracleJDK / OpenJDKis installed remove all firstly.


Prerequisite:

Image for post
Image for post

Please make sure that the ‘Xorg’ display server is being used.
To verify if the Xorg is being used, enter the following code snippet in the terminal.

$ echo $XDG_SESSION_TYPE.

If the response printed in ‘x11’, then the account is logged in as Xorg.
If you see ‘Wayland’, quite obviously, the display server in use is Wayland. Then you have to switch the display server.

Steps:

First of all, check if your current user is part of the input group. You can do that by

sudo gpasswd -a $USER input

Then log out and log back in. …

About

Hirosh Tharaka (BSc.Hons, CTFL)

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store