Find out if Java is installed in some folder. Common locations are /usr/java/jre_ or /opt/jre_nb/jre_/bin/java/ When you have located the folder, you may delete folder. Warning: You should be certain that Java is not already installed using RPM before removing the folder. Type: rm -r jre For example: rm -r jre1.7.0
Step 5) Add the following system variables to the end of /etc/profile file
JAVA_HOME=<Directory where JAVA has been extracted>/jdk1.8.0
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin export JAVA_HOME export PATH To do so –
Enter command
"sudo nano /etc/profile"
How to Install Java On Ubuntu Enter the system variables
How to Install Java On Ubuntu
Press Control+C to enter into command mode
How to Install Java On Ubuntu
Press ^+X to Exit
How to Install Java On Ubuntu
Press “Y” to save the changes Step 6) Now reload environment using a command,