aphwwq
Last Updated: March 08, 2016
·
6.844K
· mdeiters
12003957 10206752435102297 2524621803006121539 n

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.

Say Thanks
Respond

6 Responses
Add your response

299
7c47290553dbe34d915af4c1b3ab4001

You, sir, are a lifesaver!

over 1 year ago ·
467
8067c68c508929bc12349b850683ae33

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

over 1 year ago ·
1689
7537497c81e9459b087828c5c27a8668

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 ·
3318

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 ·
3778

@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 ·
7227
Cdb03c8d9c3977b43e3be1ef540e7a79

Thanks!!

over 1 year ago ·