I'm trying to set JAVA_HOME for
elasticsearch but no luck till now.
I tried to set it in
etc/.profile all fail.
this is the command I use to run elasticsearch:
sudo /etc/init.d/elasticsearch start
I tried debug the JAVA_HOME variable in terminal like this:
sudo echo $JAVA_HOME
I got the result
/home/mockie/softwares/jdk1.8.0_45 for the both which is correct path for my JAVA.
I also tried debug
/etc/init.d/elasticsearch like this:
echo "$JAVA_HOME/dodol" exit 1
and the result was empty and only return "/dodol".
this is full code for
and this is my
but when I try this :
$ sudo su $ /etc/init.d/elasticsearch start
and it works! but what I want is to use
sudo /etc/init.d/elasticsearch start without
sudo su first. is it possible?