Set JAVA_HOME temporary :
export JAVA_HOME=/usr/lib/jvm/default
Set JAVA_HOME permanently for all Users :
sudo nano /etc/profile
export JAVA_HOME=/usr/lib/jvm/default export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile
References
https://stackoverflow.com/questions/24641536/how-to-set-java-home-in-linux-for-all-users
https://docs.opsgenie.com/docs/setting-java_home
https://bbs.archlinux.org/viewtopic.php?id=222751