how to install,and configure java on linux

Install Oracle Java Runtime Environment (JRE)

To check if you Oracle Java installed, type the following command in Terminal.

java -version

which reside at /usr/bin/java

get Oracle Java from the website at



  1. Create a folder named oracle-jre and navigate into it.
  2. Copy the downloaded “tar.gz” archive file into this directory.
  3. Select the “tar.gz” archive, right-click it and choose to extract its contents. This will create a directory at the location /opt/oracle-jre/jre.XXXXX, where XXXXX will vary according to the version of the JRE that you have downloaded.

Now, test the Java installation using the following command:

/opt/oracle-jre/jreXXXXX/bin/java -version

If you did not have any Java installation prior to this, then you can make this new Java installation available system-wide by typing the following command.

sudo ln -s /opt/oracle-jre/jreXXXXX/bin/java /usr/bin/java

This will create a link in the usr/bin directory for your Java executable. You will then be able to access the Java executable without having to use the full path to the /opt/oracle-jre/jreXXXXX/bin/. For example, the java -version would start working.