ES_JAVA_OPTS ignored

  1. Installed ES 0.20.0.RC1 from .deb
  2. Starting up, the log shows a warning (~ "JVM should be configured with
    -server flag")

So I tried exporting ES_JAVA_OPTS="-server", echo $ES_JAVA_OPTS shows
But to no avail ...

I hardcoded the option into to see if it works at all -
which it does.

So where to put this setting (and others)? In the YAML configuration file I
didn't find anything related to the JVM like min/max ram size and the like
... Documentation didn't help, either.

I'd really appreciate keeping these settings in one place like the YAML,
this should be easily possible, shouldn't it?



if you need to add the server flag to the JVM, what Java JRE/JDK have you

I recommend installing the latest Oracle Java 7 JDK, there is no such thing
like "server VM" anymore. Please note that Java 6 is set end-of-life by

The reason the JVM startup options can not be intermixed with the
elasticsearch config are the separate startup phases each Java app must
pass. The JVM options are early initialization parameters and are effective
before any Java app code is active. Such parameters can be shared between
Java apps. Then, after the JVM has started and Elasticsearch jars have been
loaded und bootstrapped, the YAML parser loads the ES
config/elasticsearch.yml und continues the startup process which is
specific to ES.

Best regards,



Hi Jörg,

thank you for clarification!

I forgot to mention that I'm using openjdk-6-jre-headless. Might give the
Oracle 7 JRE a try but manual updating bothers me as of now. states that you need Java 6 for running ES -

plus, on the same page, that you can control the JVM from inside the
elasticsearch.conf ("Note, passing JVM level configuration (such as -X
parameters) should be set within the elasticsearch.conf file.")

which is incorrect as you're saying!? Or is this a file also used by the
shell script/service wrapper or the like?

So whom to believe - and where to put the JVM settings (-server flag for
Java 6 and others like mem limits as well) as using ES_JAVA_OPTS didn't


Hi Hans,

I could tell a long story about Project IcedTea, OpenJDK /JDK 6/7, a bit
awkward and confusing, so I won't.

To make a long story short

  • openjdk-6-jre-headless is NOT Java 6. It is an early fork of OpenJDK 7,
    GPLed, more than 2 years old, with source codes and bugs that are not in
  1. See
    for clarification.
  • for best out-of-the-box Java experience, I always recommend to install
    the latest aligned runtime environments of OpenJDK 7 = Oracle Java 7. That
    is independent of Elasticsearch. In Java 7, the preconfigured JVM settings
    for "client VM" and "server VM" are so close, there is no longer a
    substantial difference, and there is no "-server" flag warning anymore.

  • in February 2013, Oracle will retire Java 6. Sooner or later you must
    transition to Java 7, so why not now. That is the reason I do not recommend
    Java 6.

The elasticsearch.conf file is part of the service
wrapper I
wasn't aware you want to make use of the service wrapper, because it is an
add-on. Of course I recommend using it, I use it for myself on my RHEL
servers for automatic starting up the ES node when the server is booting.

Best regards,