英文:
Elasticsearch: could not find java in bundled jdk at .../jdk/bin/java
问题
运行.bin/elasticsearch
时,我遇到了以下错误:
> 无法在位于/home/ubuntu/ElasticSearch/elasticsearch-7.8.0/jdk/bin/java
的捆绑式jdk中找到java
我完全不知道发生了什么。我知道以前已经有人提过这个问题,但我还没有找到解决办法。对于java -version
,我得到了:
openjdk version "1.8.0_265"
OpenJDK Runtime Environment(构建1.8.0_265-8u265-b01-0ubuntu2~20.04-b01)
OpenJDK 64-Bit Server VM(构建25.265-b01,混合模式)
有人可以帮帮我吗?谢谢!
英文:
When I try to run .bin/elasticsearch, I get the following error:
> could not find java in bundled jdk at /home/ubuntu/Elastic
> Search/elasticsearch-7.8.0/jdk/bin/java
I have absolutely no idea what's going on. I know this topic has been created before, but I haven't found a way to fix. For java -version
I get:
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
Can anyone help me please? Thank you!
答案1
得分: 18
> 上述错误的最可能原因是未设置 JAVA_HOME
- 要显示
JAVA_HOME
变量路径,请运行以下命令echo $JAVA_HOME
如果没有显示任何内容,请按照以下步骤进行操作:
-
要查看在 Ubuntu 上安装的所有 Java 版本,请使用此命令:
sudo update-alternatives --config java
-
使用以下命令设置您的 Java 路径:
export JAVA_HOME=<您的Java路径>
英文:
> The most probable reason for the above error is that JAVA_HOME
is not set
- To display
JAVA_HOME
variable path, run this commandecho $JAVA_HOME
If nothing appears then follow the below steps:
- To see all the java versions installed in Ubuntu, use this command:
sudo update-alternatives --config java
- Set your java path using this. -
export JAVA_HOME=<YOUR-JAVA-PATH>
答案2
得分: 0
我在Linux上遇到了类似的问题,当我运行以下命令来启动elasticsearch时:
sh elasticsearch
我遇到了以下错误:
Elasticsearch: 在.../jdk/bin/java中找不到捆绑的jdk中的java
然后我参考了官方的文档,并设置了ES_JAVA_HOME环境变量。
在重新运行elasticsearch之后,我得到了以下消息,并且它成功运行了:
忽略 JAVA_HOME=/project/jdkForElasticSearch/;使用 ES_JAVA_HOME
注意: 在设置环境变量之后,请重新启动终端以反映其中的更新值。
英文:
I had the similar problem on linux, when I was running elasticsearch using
sh elasticsearch
I got the error
Elasticsearch: could not find java in bundled jdk at .../jdk/bin/java
Then I referred to the official document
and set ES_JAVA_HOME environment variable.
After running elasticsearch again, I got the following message and it ran successfully
ignoring JAVA_HOME=/project/jdkForElasticSearch/; using ES_JAVA_HOME
Note: After setting environment variable, restart your terminal to reflect the updated value in it.
答案3
得分: -1
我也遇到了相同的错误,我需要做的就是 -
- 检查是否已经设置了JAVA_HOME作为环境变量?如果是的话,删除它,然后在Windows上简单地运行elasticsearch.bat。
成功运行后,将JAVA_HOME设置为所需的值。
英文:
i was also getting the same error and all i have to do is -
- check if already have JAVA_HOME set as ENV variable ? if yes, remove it and simply run elastaicSearch.bat for windows.
Once succesfully run , set the JAVA_HOME to desired value
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论