Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Git Bash can't run ./bin/opensearch command. #10214

Closed
davidosorno opened this issue Sep 25, 2023 · 6 comments
Closed

[BUG] Git Bash can't run ./bin/opensearch command. #10214

davidosorno opened this issue Sep 25, 2023 · 6 comments
Labels
bug Something isn't working Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement.

Comments

@davidosorno
Copy link

Describe the bug
Using Git Bash on Windows I run ./bin/opensearch and got a Java error that can't load the main class.

$ ./bin/opensearch
Error: Could not find or load main class org.opensearch.tools.java_version_checker.JavaVersionChecker
Caused by: java.lang.ClassNotFoundException: org.opensearch.tools.java_version_checker.JavaVersionChecker

To Reproduce
Steps to reproduce the behavior:

  1. Using Git Bash on Windows, go to 'OpenSearch/build/distribution/local/opensearch-3.0.0-SNAPSHOT/'
  2. Run ./bin/opensearch
  3. See error.

Expected behavior
I expected Git Bash runs the OpenSearch project and make the localhost:9200 available.

Screenshots

Screenshot 2023-09-25 084901

Screenshot 2023-09-25 082615

Screenshot 2023-09-25 071001

Screenshot 2023-09-25 084717

Host/Environment (please complete the following information):

  • OS: Windows
  • Version 11
@davidosorno davidosorno added bug Something isn't working untriaged labels Sep 25, 2023
@dtaivpp
Copy link

dtaivpp commented Sep 25, 2023

I just thought about this, does it run when you do ./gradlew run?

@davidosorno
Copy link
Author

davidosorno commented Sep 25, 2023

Yeah, it worked.

image

Any idea, why did it work?

@HJohnRoss
Copy link

HJohnRoss commented Sep 25, 2023

I also tried ./gradlew run, it did not work for me, I had some errors ill post in a edit

image

edit: same thing actually (I remember some run errors the first time that I had tried I am pretty sure)

@davidosorno
Copy link
Author

Hi @HJohnRoss, I think is working. Try the following:

  1. Run the command ./gradlew run and it should finish like this (don't stop or close this window).
    image

  2. Then go to http://localhost:9200/_cat/health and you should see something like this
    image

@ankitkala ankitkala added Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement. and removed Other labels Dec 17, 2023
@bbarani bbarani removed the untriaged label Jan 30, 2024
@peterzhuamazon
Copy link
Member

It is recommended to run opensearch-windows-install.bat in the root of the Windows ZIP extracted folder, as we have a lot of setups happens there, before launching opensearch.

The opensearch-windows-install.bat is internally calling bin/opensearch.bat instead of bin/opensearch, as the latter was written with NIX* in mind afaik, not always support git bash, or even full ledge mingw/msys2. So running bin/opensearch.bat is always recommended for the Windows specific distribution.

Thanks.

@bbarani
Copy link
Member

bbarani commented Jan 30, 2024

@davidosorno @HJohnRoss Please try the suggestion provided by @peterzhuamazon and let us know your feedback. Feel free to re-open this issue if you need additional assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement.
Projects
None yet
Development

No branches or pull requests

7 participants