1.

# sudo vim /etc/environment
...
...
...
JAVA_HOME=/opt/jdk  <--- your jdk path
...
...
...
:wq!

2.

# source /etc/environment
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.