Hadoop builds on top of Java. So first check in your system Java is present or not. After Java installation, you need to set JAVA_HOME & PATH. Try to set these variables in .bashrc file. You can use the below-given command to find your JAVA_HOME & PATH.
$ which java
Also, change the value of HADOOP_OPTS as given below.
In your hadoop-env.sh file export the value of HADOOP_CONF_DIR. Hadoop internally searches these variables and if it finds different values, it may give an error.