I'm working on apache solr 5,when I'm trying to execute $ bin/post -c gettingstarted example/exampledocs/*.json
, I am getting warning like
'bin' is not recognized as an internal or external command, operable program or batch file.
It's working when I execeute bin\solr create -c test
.
Please help me out, I'm new to solr concepts.
Thanks
The “is not recognized as an internal command” error usually occurs because the computer can't find the executable that you're asking it to launch. However, you can provide it with the full path to your executable file and it should then be able to run it without any issues.
> npm --version 'npm' is not recognized as an internal or external command, operable program or batch file. The error above happens when the Windows operating system doesn't know what to do with the npm command. To fix the error, you need to make sure that the Node executable file is available under your PATH setting.
If you're coming up against app or command 'is not recognized as an internal or external command' errors when trying to do something in the command line, update an app or install something new, you're not alone. It happens when Windows environmental variables are changed which prevent the command being run.
the issue is not with Solr, its with the command you are typing. Linux directories are traversed using '/' while windows with '\'. Assuming your OS is windows, from your current working directory (which is the solr folder in this example) bin\solr is a valid path, hence that executes. however bin/solr being an invalid path fails to execute. Hence your first command should work from the same location in Unix/Linux systems, second one in Windows
EDIT: I just downloaded the solr installer as zip from the solr site. The post file is indeed a shell script, which is why you are unable to execute it on windows. (my understanding was that .gzips were linux installers and .zip for windows always, which is clearly not the case here.)
What you probably can do is check this answer and follow the approach mentioned there. Hopefully that will get you up and running.
Hope it helps!
Although it is too late to answer this question, but it might be helpful to others who face this issue.
bin/post
exists only as Unix shell script. Internally it uses a Java program SimplePostTool
, which is present in the jar : example\exampledocs\post.jar
. To use post
in Windows, run the command java -jar example/exampledocs/post.jar
instead of bin\post
. For example, post -h
can be run as : java -jar example/exampledocs/post.jar -h
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With