【发布时间】:2018-07-20 19:11:48
【问题描述】:
我想开始使用 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 '输入{标准输入{}}输出{标准输出{}}'
然后我得到一个错误
文件\Java\jdk1.8.0_144\bin 无法找到或加载。 (对不起,我用德语开发,我不知道英文错误信息)
我在这台电脑上运行 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-版本
输出
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找不到它?我必须设置一些额外的东西吗? 在系统变量中,我将 jdk 和 jre 设置为“路径”变量,并在用户变量中创建了一个 JAVA_HOME 变量。 提前致谢
【问题讨论】:
-
"文件\Java\jdk1.8.0_144\bin 无法找到或加载。"路径缺少前缀 - “C:\Program”。这只是复制/粘贴错误,还是实际错误中的情况?
-
这是错误语句:Error: Main class Files\Java\jdk1.8.0_144\bin;C:\Program could not be found or loaded
-
"Files\Java\jdk1.8.0_144\bin" 看起来像一个不完整的路径。当“javac”和“java”为你工作时——什么是logstash?脚本?可执行文件?也许那里混杂了一些东西。如果可能的话,您能否将相关的环境变量添加到您的问题中。
-
我下载了 zip 文件。打开包装,就是这样。文档仅此而已
-
您可以尝试将您的logstash安装移动到
C:\Logstash\logstash-6.3.1\bin>之类的位置,这样您的路径就没有空间了。