Configure Java environment variables for Ubuntu with Zsh configuration

open ~/.zshrc and add

to the last line

followed by the first sentence is your JDK path

export JAVA_HOME=/usr/local/jdk1.8/jdk1.8.0_131 
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH


Read More: