# ES\_JAVA\_OPTS ignored

**URL:** <https://discuss.elastic.co/t/es-java-opts-ignored/9960>\
**Category:** Elasticsearch\
**Created:** [December 5, 2012, 9:36pm UTC](https://discuss.elastic.co/t/es-java-opts-ignored/9960 "2012-12-05T21:36:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hans1](https://avatars.discourse-cdn.com/v4/letter/h/e68b1a/32.png) [@Hans1](https://discuss.elastic.co/u/Hans1)\
**Post date:** [December 5, 2012, 9:36pm UTC](https://discuss.elastic.co/t/es-java-opts-ignored/9960/1 "2012-12-05T21:36:42Z")

</div>

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  
"-server"  
But to no avail ...

I hardcoded the option into elasticsearch.in.sh 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?

--

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 5, 2012, 11:38pm UTC](https://discuss.elastic.co/t/es-java-opts-ignored/9960/2 "2012-12-05T23:38:49Z")

</div>

Hi,

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

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  
Oracle.

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,

Jörg

--

---

<div class="post-metadata">

**Author:** ![Hans1](https://avatars.discourse-cdn.com/v4/letter/h/e68b1a/32.png) [@Hans1](https://discuss.elastic.co/u/Hans1)\
**Post date:** [December 6, 2012, 6:08pm UTC](https://discuss.elastic.co/t/es-java-opts-ignored/9960/3 "2012-12-06T18:08:44Z")

</div>

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.

elasticsearch.org states that you need Java 6 for running ES -  
[http://www.elasticsearch.org/guide/reference/setup/installation.html](http://www.elasticsearch.org/guide/reference/setup/installation.html)

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  
work?

--

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 6, 2012, 11:18pm UTC](https://discuss.elastic.co/t/es-java-opts-ignored/9960/4 "2012-12-06T23:18:32Z")

</div>

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  
Java

1. See [http://weblogs.java.net/blog/robogeek/archive/2009/01/it\_will\_be\_open.html](http://weblogs.java.net/blog/robogeek/archive/2009/01/it_will_be_open.html)  
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 [https://github.com/elasticsearch/elasticsearch-servicewrapper](https://github.com/elasticsearch/elasticsearch-servicewrapper) 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,

Jörg

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:01am UTC](https://discuss.elastic.co/t/es-java-opts-ignored/9960/5 "2017-07-06T03:01:00Z")

</div>


