Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sunspot not working with You need a Java Runtime Environment to run the Solr serve error

I am trying to start the sunspot_solr but it is giving me the following error

Sunspot::Solr::Server::JavaMissing: You need a Java Runtime Environment to run the Solr server

I have java runtime on my mac and I have tried searching on stack overflow but could not get any solution.

Saurabhs-MacBook-Pro% java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Saurabhs-MacBook-Pro% bundle exec rake --execute 'puts `which java`'
/usr/bin/java

Saurabhs-MacBook-Pro% which java                                    
/usr/bin/java

Appreciate your help.

like image 216
Saurabh Avatar asked Dec 11 '25 15:12

Saurabh


2 Answers

I had Similar situation where I got that error message, but I

  1. Installed JDK8 from: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  2. And I re-run bundle exec rake sunspot:solr:start

  3. Then I got Successfully started Solr ...

like image 101
egyamado Avatar answered Dec 14 '25 07:12

egyamado


Solr has started working after re-installing jre 7 and jdk 7. It might be because earlier I had openJDK and now I have switched to oracle.

like image 21
Saurabh Avatar answered Dec 14 '25 08:12

Saurabh