Micodel Micodel -4 years ago 138
Java Question

elasticsearch - Could not find or load main class -Xms2g

I installed elasticsearch with homebrew on Mac OSX Sierra (10.12.5).

The installation with homebrew appears successful and brew info states it is installed meeting all prerequisites.

When I go to run the "elasticsearch" command, I get the following error...

Error: Could not find or load main class -Xms2g


I have tried installing java 1.8 both via homebrew and manually.

I am using java JDK not JRE.

I also tried installing elasticsearch manually, however the installation itself fails with the same exact error.

Any insight would be appreciated.

=== UPDATE ===

Quick answer below.

Additional information can be found here:
Unable to install Elasticsearch on Mac Sierra (10.12.2)

Answer Source

If you have set :

export GREP_OPTIONS='--color=always'

in your .bashrc or somewhere else, it will probably broke shell pipes and causes problems. Try to remove it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download