or
Open .bashrc and .profile file and set the JAVA_HOME with below commands on terminal-
i. Type vi ~/.bashrc it will open a vi editor, of-course you can open in any editor like gedit,nano etc.
ii. Place this