The easiest way to set the environment variable is to export:
$ export JAVA_HOME="/usr/bin"
This will temporarily set the desired variable. You can check if this has been installed with:
$ echo $JAVA_HOME
or
$ printenv
If you need a more permanent solution, add 'export JAVA_HOME = "/ usr / bin" "to the .bashrc or .bash_profile file.
To check if Java is installed correctly:
$ which java $ which javac
You should get a similar output:
/usr/bin/java
Povilasb
source share