Oracle Java Runtime For Ubuntu: How to Run Java JRE Environment in your PC-
The first thing to do is find the name of the actual file that was downloaded from the Oracle website. To do this run the following commands:
The first command will change the directory to your “Downloads” folder. The second command provides a directory listing of all the files beginning with “jre”.
You should now see a filename looking something like this:
Take a note of the file name or select it with the mouse, right click and choose copy.
The next step is to navigate to the place where you plan to install Java and extract the zipped up tar file.
After Unzip Java Environment File you can Change its Name called : jre ( Folder ). Then Follow –
Run the following commands:
sudo mkdir /usr/java
sudo tar zxvf ~/Downloads/jre.tar.gz
The files will now be extracted into the /usr/java folder and that is it.
To remove the downloaded file run the following command:
sudo rm ~/Downloads/jre.tar.gz
The final step is to update your environment file so that your computer knows where Java is installed and which folder is the JAVA_HOME.
Run the following command to open the environment file in the nano editor:
sudo nano /etc/environment
Scroll to the end of the line that begins PATH= and before the final ” enter the following
Then add the next line:
Save the file by pressing CTRL and O and exit the editor by pressing CTRL and X.
You can test whether Java is working by typing the following command: