在Windows系统中运行Logstash遇启动问题求助
Let’s work through this issue step by step—this error usually boils down to a missing/corrupted JRuby directory, environment misconfiguration, or permission issues. Here are the solutions to try:
1. Verify the JRuby directory exists
First, double-check that the vendor/jruby folder is actually present in your Logstash installation. Navigate to C:\ELK\logstash-6.1.3\vendor—if there’s no jruby folder here, your download or extraction process went wrong:
- Download the Logstash 6.1.3 zip again from the official source (avoid third-party mirrors to prevent corruption)
- Use a reliable extraction tool like 7-Zip instead of Windows’ built-in extractor, as it can sometimes fail with large archives
- Make sure the extraction completes without any error messages
2. Validate your JDK environment variables
Even if you set up a 64-bit JDK, small misconfigurations can break Logstash’s ability to find JRuby:
- Open Command Prompt and run
echo %JAVA_HOME%—it should point directly to your JDK root folder (e.g.,C:\Program Files\Java\jdk1.8.0_301), not thejresubfolder - Check that
%JAVA_HOME%\binis added to yourPATHenvironment variable, and that it appears before any other Java-related paths (this ensures the correct JDK is used) - Confirm you’re running a 64-bit JDK by running
java -version—the output should include "64-Bit"
3. Launch Logstash from the correct working directory
Sometimes starting Logstash from a different folder can cause path resolution issues:
- Open Command Prompt and navigate to Logstash’s bin directory with:
cd C:\ELK\logstash-6.1.3\bin - Then run Logstash directly with:
logstash.bat
Avoid using shortcuts or launching from a different directory, as this can confuse the path lookups.
4. Check folder permissions
Windows permissions can block Logstash from accessing the JRuby files:
- Right-click the
logstash-6.1.3folder, go to Properties > Security - Ensure your user account has Read & Execute (or Full Control) permissions for the folder and all its subfolders
- If permissions look off, click Advanced and enable permission inheritance to reset permissions for all subdirectories
5. Confirm JRuby file integrity
If the vendor/jruby folder exists but you still get the error, check for missing core files:
- Navigate to
C:\ELK\logstash-6.1.3\vendor\jruby\bin—you should seejruby.batand other executable files here - If any files are missing, re-extract the Logstash zip (using the steps from solution 1) to replace the corrupted or missing files
内容的提问来源于stack exchange,提问作者vinSan

