logstash找不到jdk

时间:2018-07-20 19:11:49

标签: java logstash

我想开始使用logstash和弹性搜索。我遵循了Elastic的文档

  

https://www.elastic.co/guide/en/logstash/current/getting-started-with-logstash.html

我想从第一个演示命令开始。我在Windows 10 64位上工作。因此,我下载了logstash.zip,打开了cmd,然后移至

  

C:\ Program Files \ Logstash \ logstash-6.3.1 \ bin>

文件夹。之后,我输入

  

logstash -e'输入{stdin {}}输出{stdout {}}'

然后我得到一个错误

  

文件\ Java \ jdk1.8.0_144 \ bin   找不到或加载。 (对不起,我用德语开发,但我不知道英文错误消息)

我在这台PC和命令

上运行eclipse和Java
  

javac

显示

> Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are used
  -classpath <path>          Specify where to find user class files and annotation processors
  -cp <path>                 Specify where to find user class files and annotation processors
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -proc:{none,only}          Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process
  -processorpath <path>      Specify where to find annotation processors
  -parameters                Generate metadata for reflection on method parameters
  -d <directory>             Specify where to place generated class files
  -s <directory>             Specify where to place generated source files
  -h <directory>             Specify where to place generated native header files
  -implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release
  -target <release>          Generate class files for specific VM version
  -profile <profile>         Check that API used is available in the specified profile
  -version                   Version information
  -help                      Print a synopsis of standard options
  -Akey[=value]              Options to pass to annotation processors
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system
  -Werror                    Terminate compilation if warnings occur
  @<filename>                Read options and filenames from file

  

java -version

输出

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

所以我想应该没问题。 谁能帮我为什么logstash找不到它?我需要设置一些额外的东西吗? 在Systemvariables中,将jdk和jre设置为“ Path”变量,并在“用户变量”中创建了JAVA_HOME变量。 预先感谢

1 个答案:

答案 0 :(得分:0)

看起来您的JAVA_HOME和PATH混乱了。一定是这样的

JAVA_HOME = C:\Program Files\Java\jdk1.7.0_25 
PATH = C:\Program Files\Java\jdk1.7.0_25\bin

要进行交叉检查,您可以在终端中尝试

echo %JAVA_HOME%

javac -version

检查类PATH变量。

您可以参考this link逐步设置变量。