2

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?

2
  • you need at minimum JRE to run elasticSearch. java.exe and jre are the same. Commented Mar 13, 2017 at 15:18
  • ok thanks, so there is no need for JAVA_HOME to be set, right? Commented Mar 13, 2017 at 15:25

1 Answer 1

2

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)

Sign up to request clarification or add additional context in comments.

2 Comments

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
Yes you can, the only thing you have to be careful of is when upgrading to new version

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.