I finally figured out the error after
exporting the JAVA_HOME and PATH in .bashrc
. Exporting it into /etc/profile didn’t work out.
I added export JAVA_HOME=/usr/lib/java/jdk1.8.0_221
in .bashrc script and the issue was resolved
export PATH="$PATH:$JAVA_HOME/bin"
1 Like