1

I want to run solR in mac OSX 10.9.1. So I installed JRE latest version. Then, I downloaded solR and expanded the folder. But when I try to run this jar file in example folder, I get this msg "no java runtime present", mentioned below.

Do I need to add JAVA_HOME env variable like we do in windows? If so, please tell me how.

Ananyas-MacBook-Pro:~ ananya$  /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/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) 
Ananyas-MacBook-Pro:~ ananya$ cd /Users/ananya/Desktop/VT\ study/solr-4.6.1/example 
Ananyas-MacBook-Pro:example ananya$ java -jar start.jar 
No Java runtime present, requesting install. 
Ananyas-MacBook-Pro:example ananya$

Thanks.

jeremyjjbrown
  • 7,772
  • 5
  • 43
  • 55
ac11
  • 927
  • 2
  • 11
  • 18

1 Answers1

0

"Do I need to add JAVA_HOME env variable like we do in windows?"

Test to see if/where Java is on your path in a terminal:

echo $JAVA_HOME

If the path to Java is wrong or missing you can add and Environmental Variable to ~/.bash_profile like so

JAVA_HOME=/usr/bin/java  #or whatever your path is
export PATH=$PATH:$JAVA_HOME/bin/

You can open ~/.bash_profile in a terminal with nano

nano ~/.bash_profile. 

Nano hint: writeout means save.

You'll need to reopen your terminal to load the new path. Or, reload it with the source command.

source ~/.bash_profile

Alternatively, if you like saving keystrokes you can type

. ~/.bash_profile
jeremyjjbrown
  • 7,772
  • 5
  • 43
  • 55
  • can you post the results of "echo $JAVA_HOME" ? – jeremyjjbrown Feb 08 '14 at 02:34
  • Then Java is not on your path. Mine returns `/usr/bin/java` Can you put your ~/.bash_profile in your post? – jeremyjjbrown Feb 08 '14 at 03:52
  • Its empty. Do I need to put anything in that? – ac11 Feb 08 '14 at 16:34
  • Add to it just like I said in the answer. You can open it in a terminal with `nano ~/.bash_profile`. Nano hint "writeout" means save". – jeremyjjbrown Feb 08 '14 at 17:28
  • I added the path in bash profile. Even then when I try to run solR, it says "No java runtime present" – ac11 Feb 08 '14 at 23:56
  • so if you type `java -version` in a terminal java gives you it's info, right? – jeremyjjbrown Feb 09 '14 at 00:11
  • no it doesn't. it says "no java runtime present". Anyways...I got pissed off. So installed JRE and running SolR in my windows pc. Thanks for your time, btw :) – ac11 Feb 15 '14 at 03:53
  • Well that means that in spite of your attempts you still don't have java on your path. If you put the contents of `cat ~/.bash_profile` into your post I can help you fix it. – jeremyjjbrown Feb 15 '14 at 14:53
  • I installed JRE following the solution in this post http://stackoverflow.com/questions/19533528/installing-java-on-os-x-10-9-mavericks – ac11 Mar 13 '14 at 16:07
  • But then when I try to run any java application, I get this error Error occurred during initialization of VM Could not find agent library: libcalljvmti.jnilib (searched /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries:/System/Library/Java/Extensions:/Library/Java/Extensions:.) – ac11 Mar 13 '14 at 16:28