Logstash cnfiguration error

So I have both elasticsearch and kibana both up and running on a linux staging server . Now i am trying to configure logstash ans run it

I wrote a logstash-simple.conf file put it in the bin folder

when i try to run logstash using the command

./logstash -f logstash-simple.conf

it gives me the error...Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME."

I have java up and running perfectly when i check java -version and which java command...i am not sure whats going on here..

Didn't you have the same problem here - Installing elasticsearch logstash and kibana on a linux server error

Yes, but it's already fixed though. I will try moving the contents to a different folder..

It works now!

I used the following command to fix it:
export JAVACMD=which java