I have tihis error -----Error: JAVA_HOME is not defined correctly.Can not sure execute /usr/local/jdk/bin/java

Hi I have the following error: Error: JAVA_HOME is not defined Correctly.
Can not sure execute / usr / local / jdk / bin / java.
would not let me connect to Spark and kill the java service now I can not start services in openfire
could someone help me?