首页 > 解决方案 > OpenJDK 64 位服务器 VM 警告 Elasticsearch 在 Windows 10 中不起作用

问题描述

我似乎在堆栈溢出中找不到与我的问题相关的任何内容。我已经下载了 jdk 13.0 和 elasticsearch 7.4.0。

在 C:\Users\Desktop\download\elasticsearch-7.4.0-windows-x86_64\elasticsearch-7.4.0\bin 的 cmd 设置路径上,我执行:

elasticsearch.bat

哪个输出:

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <?> at index 9: C:\Users\???\AppData\Local\Temp\elasticsearch
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
        at org.elasticsearch.common.io.PathUtils.get(PathUtils.java:60)
        at org.elasticsearch.env.Environment.<init>(Environment.java:95)
        at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:69)
        at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:95)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)

我已经阅读了https://github.com/elastic/elasticsearch/issues/43911并且人们说他们已经通过增加 kubernetes 中的内存来解决它。我不了解 kubernetes,也没有使用它,所以我决定发布这个问题。

有人能告诉我为什么运行 elasticserach.bat 失败了吗?

编辑:正如开发人员建议的那样

我已阅读https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html并按照程序操作,但仍然给我相同的错误消息。

但与我所遵循的资源相比,我的道路似乎很奇怪。这是我的路径:

C:\Users\myname\Desktop\download\jdk-13.0.1_windows-x64_bin\jdk-13.0.1

这给了我和以前一样的错误。

我注意到 java.exe 在 jdk-13.0.1 内的 bin 文件夹中,所以我尝试将系统变量的值设置为

C:\Users\myname\Desktop\download\jdk-13.0.1_windows-x64_bin\jdk-13.0.1\bin

现在它给了我:

"could not find java in JAVA_HOME or bundled at C:\Users\myname\Desktop\download\elasticsearch-7.4.0-windows-x86_64\elasticsearch-7.4.0\jdk"

我清楚地看到bin文件夹中的java.exe,为什么它说它找不到它?

标签: elasticsearch

解决方案


推荐阅读