Follow Our Previous Article based on How to install java 8 on redhat/CentOS Machine.
Here, I’m going to show you how to set the path for java on linux machine. This is very important in order to run the java code or compile them.
Step 1 :
Location of java installation is /usr/java/
Now You will have to find a bashrc file
Step 2 : You can find that file by a command
Here you have to put these settings to set the java path
Go the file vim ./ .bashrc
Step 3 : Put these lines in this file
Set path for jdk
Step 4 : run this command to reload the bashrc file
Step 5 : Verify java path has been properly set or not by command mentioned below
If path is set properly it will show you output otherwise it’s blank output.
Now JAVA path is set successfully You can see the output.