Before redeploy my application and restart my server, Sunsport Solr stopped and can`t be started anymore, although it was working before the redeploy + restart. When I run
rake sunspot:solr:run RAILS_ENV=production --trace
I receive the following
** Invoke sunspot:solr:start (first_time)
** Invoke environment (first_time)
** Execute environment
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
** Execute sunspot:solr:start
rake aborted!
You need a Java Runtime Environment to run the Solr server
But java -version return the following:
java version "1.7.0_45"
OpenJDK Runtime Environment (rhel-2.4.3.4.el6_5-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
Don`t know what to do anymore, already tried to remove solr folder from the app and run the install again (rails g sunspot_solr:install) , but no lucky...
I`m on Ruby 2.0.0 Rails 4.0.0.rc1 and the last version of sunspot solt
You need to make sure that you have a valid Java Runtime (e.g. /usr/bin/java) and also have a valid JDK installed.
When you run `which java`, if you don't have a valid JDK installed, you will get an error to that effect.
You will not be able to run the Solr server if you don't have both installed.
I got the same error. When running the following command.
$ bundle exec rake sunspot:solr:start -t
** Invoke sunspot:solr:start (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute sunspot:solr:start
rake aborted!
Sunspot::Solr::Server::JavaMissing: You need a Java Runtime Environment to run the Solr server
By using this command
$ bundle exec rake --execute 'puts which java'
I am getting '/usr/bin/java'.
But by the following command
$ java --version -> 'No Java runtime present, requesting install.
I am using Mac OSX and it prompted a message and clicking on more info it goes to:
oracle.com/technetwork/java/javase/downloads/index.html
So I installed JDK 8 from the link:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
for mac OSX
http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-macosx-x64.dmg
$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
After that Solr server run successfully :) .
In your case you have to reinstall the JDK from the above link to make it work
You have openJDK runtime environment. Switch to Java(TM) SE Runtime Environment, to make Solr work. Read this (difference-between-oracle-jdk-and-open-jdk)
Run the Solr server background by
$ bundle exec rake sunspot:solr:start -t
Successfully started Solr ...
Stop Solr server:
$ bundle exec rake sunspot:solr:stop -t
Start solr server in the foreground:
$ bundle exec rake sunspot:solr:run -t
'rake' unable to find the java.
Make sure java executable is in your path that the rake task can see.