javajava-8solrsolr8

Solr 8.3.1: could not find or load org.apache.solr.util.SolrCLI


So I'm new to Solr and am following tutorials for the most part using Solr 8.3.1 (the most recent release as of posting).

I've got Java version 1.8.0_181 installed on my Windows 10 machine and I've added solr/bin to the PATH variable.

When I run solr start I get:

/d/Program Files and Documents/solr-8.3.1/bin/solr: line 1525: ulimit: -m: invalid option
ulimit: usage: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
*** [WARN] *** Your open file limit is currently 256.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 256.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
/d/Program Files and Documents/solr-8.3.1/bin/solr: line 1542: [: !=: unary operator expected
NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 8983.

Started Solr server on port 8983 (pid=). Happy searching!

Which says to me that it started running, but when I run solr status I get:

Found 1 Solr nodes:

Solr process 56136 from /d/Program Files and Documents/solr-8.3.1/bin/solr-8983.pid not found.

Which doesn't seem right. I continued with the tutorial anyway and ran solr start -e cloud and got:

$ solr start -e cloud
/d/Program Files and Documents/solr-8.3.1/bin/solr: line 1525: ulimit: -m: invalid option
ulimit: usage: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
*** [WARN] *** Your open file limit is currently 256.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 256.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
/d/Program Files and Documents/solr-8.3.1/bin/solr: line 1542: [: !=: unary operator expected
Error: Could not find or load main class org.apache.solr.util.SolrCLI

I tried solr start -e techproducts with the same result.

I've seen answers for this with earlier versions of Solr and usually the answers involved updating the Solr version... Which I'm already at the most recent? I'm sure I'm missing something dumb, but any pointers in the right direction would be much appreciated! Thanks so much!

EDIT 1: Solved! Was using Git Bash which is Cygwin-based. Works like a charm with Windows Command Prompt and with Windows Powershell.

Output for solr start:

Java HotSpot(TM) 64-Bit Server VM warning: JVM cannot use large page memory because it does not have enough privilege to lock pages in memory.
Waiting up to 30 to see Solr running on port 8983
Started Solr server on port 8983. Happy searching!

Output for solr status:

Found Solr process 50764 running on port 8983
{
  "solr_home":"D:\\Program Files and Documents\\solr-8.3.1\\server\\solr",
  "version":"8.3.1 a3d456fba2cd1b9892defbcf46a0eb4d4bb4d01f - ishan - 2019-11-29 11:51:37",
  "startTime":"2019-12-19T22:20:25.127Z",
  "uptime":"0 days, 0 hours, 0 minutes, 14 seconds",
  "memory":"176.3 MB (%34.4) of 512 MB"}

Output for solr start -e cloud:


Welcome to the SolrCloud example!

This interactive session will help you launch a SolrCloud cluster on your local workstation.
To begin, how many Solr nodes would you like to run in your local cluster? (specify 1-4 nodes) [2]:


Solution

  • Seems like you're running the *nix-version of bin/solr under cygwin from the /d/... path. Under Windows you should use the bin/solr.cmd command with the standard command line console (´cmd.exe`).

    It seems the solr.in script contains options not recognized by the version you have of bash inside cygwin. I'm guessing that could also affect the setup of the classpath which means that the classes aren't found where they'd be expected to.