As per title, is it really required to have JAVA_HOME set on the host PC? Can I run ElasticSearch by just specyfing the full path of the java.exe vm?
-
you need at minimum JRE to run elasticSearch. java.exe and jre are the same.logger– logger2017-03-13 15:18:43 +00:00Commented Mar 13, 2017 at 15:18
-
ok thanks, so there is no need for JAVA_HOME to be set, right?Gianluca Ghettini– Gianluca Ghettini2017-03-13 15:25:07 +00:00Commented Mar 13, 2017 at 15:25
Add a comment
|
1 Answer
Not exactly, if you look at the starting script of elasticsearch:
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA=`which java`
fi
So basically, either you have $JAVA_HOME set, or you have installed Java in your system and the system knows its location (the which java should at least return a path when ran in a shell, something like /usr/bin/java)
2 Comments
Gianluca Ghettini
Ok thanks, but I guess I can modify the script and point it to a known location of java. I know it sounds weird and it's not recommended but I can just modify the script and not use the JAVA_HOME
Adonis
Yes you can, the only thing you have to be careful of is when upgrading to new version