views:

106

answers:

3

I have a Windows 7 64-bit machine. I have Java Runtime Environment for both 32-bit and 64 bit installed on the machine. How do I tell Solr to use the 64-bit version of JRE when I start up Solr?

+1  A: 

If, by, start up SOLR you mean start Tomcat with the solr.war installed, then your question is really about how to tell Tomcat to use 64 bit java. I don't have the answer exactly, but I think you can just edit the catalina.bat file. In any case, Google for Tomcat + 64-bit java and see what comes up.

harschware
+2  A: 

Assuming you are running Solr in Tomcat: Set your JAVA_HOME environment variable to point to the 64-bit version of Java instead of the 32-bit. Then execute startup.bat in Tomcat.

Other servlet containers should also be observing the JAVA_HOME environment variable, but I cannot speak for any other than Tomcat.

jdmichal
This is right for Tomcat, but I don't agree with "Other servlet containers should also be observing the JAVA_HOME environment variable." JAVA_HOME is not standard. There's no reason to expect applications to use it.
erickson
@erickson While not officially standardized, I do believe that `JAVA_HOME` is more or less standard, in that it is used by many applications when the location of the JDK installation folder is necessary. The other option for a program startup script would be to just attempt to call `java.exe` and hope its on the PATH.
jdmichal
I am using the Jetty web server, not Tomcat. Thanks for your suggestions but I have posted an answer to my own question below.
hungster
A: 

Thanks for the suggestions. But I found out what I did wrong. By starting up Solr, I meant running the 'java -jar start.jar' command with the Windows Command Prompt. To start up Solr using the 64-bit JRE, you have to use the Windows Command Prompt for 64-bit. I wasn't aware of two different versions of the Windows Command Prompt (32-bit and 64-bit).

hungster