Jony Mittal
Jony Mittal

Reputation: 151

Installing Solr on Windows 10

Hi I'm a fairly new programmer whos trying to install Solr on Windows 10 i download Solr from http://mirror.fibergrid.in/apache/lucene/solr/6.2.1

The only two requirements are a Solr release and Java 1.8 or later. I have installed Solr, and also verified my java -version to see what my java version is, which is 1.8.0_60. I have went to the solr/solr/example folder, which looks fine. Then I use java -jar start.jar I am facing below issue:

Unable to access jarfile start.jar

Why is this doing this? My java version is as up to date as it says it should be?

Upvotes: 1

Views: 6537

Answers (4)

Krishna
Krishna

Reputation: 8516

Below are the steps for setting up the Solr 7.4 (With SQL Server as data source) and explore the features of solr.

  1. Download the solr 7.4 distribution from the below link

    https://archive.apache.org/dist/lucene/solr/7.4.0/

  2. Extract the Solr distribution archive to your local home directory, for instance say F:\solr-7.4.0

  3. After extracting the solr distribution zip file, the folder structure would be like F:\solr-7.4.0..

  4. Download the Java Jdk 8 and install the jdk.

  5. After installing the jdk, jdk and jre will be installed in the path C:\Program Files\Java.. (as shown in the screenshot below). enter image description here

  6. Also, make sure the java.exe file is present in the path C:\Program Files(x86)\Common Files\Oracle\Java\javapath\bin.. (Screenshot below) enter image description here

  7. Environment Variables Change for Javapath setup:- Create variable with name ‘Path’ under ‘User variables’ section if not already exists.If variable with name ‘path’ already exists under ‘User Variables’ section , select the variable ‘Path’ and click ‘edit’ and add the entry ‘C:\Program Files\Java\jdk1.8.0_351\bin’ (Screnshot below). enter image description here

  8. Similarly, Create variable with name ‘JAVA_HOME’ under ‘System variables’ section if not already exists. If variable with name ‘JAVA_HOME’ already exists under ‘System Variables’ section , select the variable ‘JAVA_HOME’ and click ‘edit’ and add the entry ‘C:\Program Files (x86)\Common Files\Oracle\Java\javapath’ (Screnshot below). enter image description here

  9. Make sure the ‘apache-solr-dataimporthandler-..’,’mssql-jdbc-..’ and ‘sqljdbc42’ jar files are present in the location ‘F:\solr-7.4.0\solr-7.4.0\contrib\dataimporthandler’ (Screenshot below). These files are used for extracting the data from sql server database enter image description here

  10. Open the ‘solr.cmd’ command file under ‘F:\solr-7.4.0\solr-7.4.0\bin’ search for the text ‘log4j2’ and set the LOG4J_CONFIG path as below. (Screenshot also attached below). set “LOG4J_CONFIG=file:///%SOLR_HOME%\server\resources\log4j2.xml” enter image description here

  11. Note:- (imp) If we don’t set the log4j2.xml path as above in the step 9, we will get the exception as shown below when we start the solr. Don’t forget to configure the step 10. enter image description here

  12. Now navigate to the bin folder of the solr (F:\solr-7.4.0\bin) and run the below command. (screenshot below) Solr start enter image description here

  13. You can now see the solr is running on port 8983. Now, open the browser of your preference (say edge) and type http://localhost:8983/ and you should see solr running. (screenshot below). enter image description here

  14. You can also run solr at different port number if needed. (say 80). To do this, navigate back to command prompt and run ‘solr stop -all’. This command will stop all the running instances of solr. Now run ‘solr start -p 80’. (this command will run the solr instance in port 80) (screenshot below). enter image description here

Upvotes: 0

Nitin Agrawal
Nitin Agrawal

Reputation: 41

I hope your problem is resolved but still if anyone trying to use Solr on Windows then I followed below steps for Solr8.5.2 -

  1. Download the binary zip file of required version.
  2. Unzip the file.
  3. First do basic check if you can start Solr server -
    a) Go to solr-8.5.2\bin in command prompt
    b) Type solr -help, then use solr start
    c) If you can see the help contents & server is starting, by default it will be on port 8983
    d) now trying accessing its web page via http://localhost:8983/solr/#/
    e) If you see everything till now then congratulations, your initial test is passed.
  4. Now let us add environment variables on Windows machine & same you can do to your Linux/Unix machine also -
    a) Add solr_home with value <\path>\solr-8.5.2\server\solr
    b) Add <\path>\solr-8.5.2\bin in path variable
  5. Now you can execute solr commands in your command prompt without giving full path to Solr directory.
    I don't think command is java -jar start.jar, rather use solr start to start the Solr server.
    Hope it helps.

Upvotes: 1

user4398985
user4398985

Reputation:

I will explain the approach on Widows 10 for solr-6.2.1:

Navigate to the solr-6.2.1 file and see whether you have below contents?

C:\Users\userName\Downloads\solr-6.2.1\solr-6.2.1\bin>ls
init.d                   oom_solr.sh  solr      solr.in.cmd
install_solr_service.sh  post         solr.cmd  solr.in.sh

Once you see solr you can smile :) and try this!!

C:\Users\Shivasai\Downloads\solr-6.2.1\solr-6.2.1\bin>solr start
Waiting up to 30 to see Solr running on port 8983
Started Solr server on port 8983. Happy searching!

After this you just have to access solr in bowser by localhost://8983

Upvotes: 3

Zahid Iqbal
Zahid Iqbal

Reputation: 31

You probably downloaded the source version, which doesn't include the start.jar file, try this one: http://mirror.fibergrid.in/apache/lucene/solr/6.2.1/solr-6.2.1.zip

Upvotes: 0

Related Questions