Last Updated: March 08, 2016
·
7.146K
· mdeiters

How to get elasticsearch to work after latest OSX java upgrade

I did a software upgrade on my mac and afterwards I was unable to start elasticsearch. I would receive a StackOverflowError[null] every time I tried to start up elasticsearch:

$ cd /usr/local/Cellar/elasticsearch/0.18.4/
$ elasticsearch -f -D es.config=config/elasticsearch.yml
[2012-09-10 09:39:15,952][INFO ][node] [Blackout] {0.18.4}[31009]: initializing ...
[2012-09-10 09:39:15,960][INFO ][plugins] [Blackout] loaded [], sites []
[2012-09-10 09:39:19,574][ERROR][bootstrap] {0.18.4}: Initialization Failed ...
1) StackOverflowError[null]

I tracked it down to the java upgrade. I was running 1.6.033, but the lastest update to 1.6.035 broke elasticsearch:

$ java -version
java version "1.6.0_35"

To fix this, simply go to Finder > Applications > Utilities > Java Preferences and drag the 32-bit JVM above the 64-bit JVM:

Picture

Elasticsearch should be working now.

I've been told upgrading to version >= 0.19.9 will also fix it.

6 Responses
Add your response

You, sir, are a lifesaver!

over 1 year ago ·

I second that! Thanks for taking the time to post.

over 1 year ago ·

Or just add -d32 to the java options inside bin/elasticsearch launch script. Just type in at the beginning:

ESJAVAOPTS="-d32 -server"

over 1 year ago ·

doesn't work for me in mountain lion. I am running java,

java version "1.6.037"
Java(TM) SE Runtime Environment (build 1.6.0
37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

over 1 year ago ·

@fuel4mind, I had to add this to my file:

JAVA_OPTS="-d32 -server"

ESJAVA_OPTS="-d32 -server"

I know the 2nd line wasn't working on its own, but things started humming once I added the first line. Not sure if the 2nd one is needed or not, but I left it in there anyway.

over 1 year ago ·

Thanks!!

over 1 year ago ·