We need to use the terminal to define JAVA_HOME environment variable and set Java path on your Linux. Use shortcut Alt+Ctrl+T to launch the command line.
How to set Java Home?
and add JAVA_HOME variable to the end of file:
Note: don’t forget to set your path to Java folder!
How to set Java path?
Add to the end of bashrc the following:
Recompile bashrc to apply changes otherwise, it will be visible only after reboot.
How to check JAVA_HOME?
Type “echo $JAVA_HOME” in the terminal.
Success output should looks like that:
Congratulations! Java Home environment variable and Java path are set on your Ubuntu environment and ready to use.