I have installed oracle java JDK 8 to my new OS (Ubuntu) but I couldnt find where should I add environment variable like in windows so that I can use java from any where of the system. Can anyone help ?
Asked
Active
Viewed 53 times
1 Answers
0
Add these lines at the end of the user profiles in the ~/.profile file or, as a superuser, at the end of the global profiles in the /etc/profile file.
export JAVA_HOME=<jre installation home directory like /usr/lib/jvm/jrel.8.0>
export PATH=$JAVA_HOME/bin:$PATH
Logout and login again.

Smily
- 2,308
- 2
- 17
- 41