Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'bin' is not recognized as an internal or external command, operable program or batch file

Tags:

php

solr

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

like image 432
Nagendra Prasad Balaka Avatar asked Mar 04 '15 13:03

Nagendra Prasad Balaka


People also ask

Is not recognized as an internal or external command batch file?

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.

Is not recognized as an internal or external command operable program or batch file NPM?

> 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.

What is not recognized as an internal or external command?

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.


2 Answers

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!

like image 123
suvartheec Avatar answered Sep 29 '22 03:09

suvartheec


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.

like image 30
Caesar Avatar answered Sep 29 '22 02:09

Caesar