The preferred location for
JAVA_HOME
or any system variable is /etc/environment
.
Open
/etc/environment
in any text editor like nano
or gedit
and add the following line:JAVA_HOME="/usr/lib/jvm/open-jdk"
(java path could be different)
Use
source
to load the variables, by running this command:source /etc/environment
Then check the variable, by running this command:
echo $JAVA_HOME
0 comments:
Post a Comment