openjdk/jdk · error
CreateProcess failed: %lu
Error message
CreateProcess failed: %lu
What it means
Windows launcher relauncher: the attempt to start the real 'java' process with CreateProcess(java_path, command_line, ...) failed (returned FALSE). Since Windows has no exec(), the relauncher must spawn java.exe and wait for it; failing here means java was never started. The message prints GetLastError() and the relauncher returns 1.
Source
Thrown at src/java.base/windows/native/launcher/relauncher.c:228
// Finally execute the real java process with the constructed arguments
if (GetEnvironmentVariable("_JAVA_LAUNCHER_DEBUG", NULL, 0)) {
char *program_name = PathFindFileName(argv[0]);
fprintf(stderr, "%s: executing: '%s' '%s'\n", program_name, java_path, command_line);
}
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
memset(&pi, 0, sizeof(pi));
// Windows has no equivalent of exec, so start the process and wait for it
// to finish, to be able to return the same exit code
if (!CreateProcess(java_path, command_line, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
fprintf(stderr, "CreateProcess failed: %lu\n", GetLastError());
return 1;
}
if (WaitForSingleObject(pi.hProcess, INFINITE) == WAIT_FAILED) {
fprintf(stderr, "WaitForSingleObject failed: %lu\n", GetLastError());
return 1;
}
DWORD exit_code;
if (!GetExitCodeProcess(pi.hProcess, &exit_code)) {
fprintf(stderr, "GetExitCodeProcess failed: %lu\n", GetLastError());
return 1;
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return exit_code;
}View on GitHub (pinned to 88dfb74bbe)
Solutions
- Confirm bin\java.exe exists next to the failing executable and can be run directly
- Decode the GetLastError() value shown in the message (e.g. 2 = ERROR_FILE_NOT_FOUND, 5 = ERROR_ACCESS_DENIED, 206 = filename/length limits) and address that specific cause
- Shorten the command line (use @argfiles, CLASSPATH env, or the JAVA_TOOL_OPTIONS file mechanism) if it is very long
- Reinstall/verify the JDK image hashes if the executable seems present but still fails (corruption or AV interference)
Example fix
# before set CLASSPATH=<10k of jars...> jdk\bin\java ... Main # after jdk\bin\java @options.txt Main # args moved to an @argfile, short command line
Defensive patterns
Strategy: validation
Validate before calling
# Verify the real launcher exists next to the relauncher and the cmdline is sane: if not exist "%JH%\\bin\\java.exe" echo missing %JH%\\bin\\java.exe & exit /b 1 java -XX:+PrintFlagsFinal -version >nul || echo launcher smoke test failed
Prevention
- Keep @argfiles for long option/classpath sets so CreateProcess never hits length limits
- Exempt the JDK directory from antivirus quarantine, or restore quarantined java.exe and re-verify the image
When it happens
Trigger: java_path (the 'java' executable expected in the same directory as the relauncher) does not exist or is not executable; the command line exceeds the 32767-character limit; the image is locked/corrupted (antivirus quarantine); insufficient permissions; or a bogus java.dll sibling blocking image load.
Common situations: JDK image with bin\java.exe deleted or quarantined; running from a read-only/network share with execute denied; extremely long CLASSPATH/options overflowing the command line; partial/corrupted JDK extraction.
Related errors
- failed to get the full path of the executable: %lu
- no '/' found in the full path of the executable
- no '\' found in the full path of the executable
- WaitForSingleObject failed: %lu
- GetExitCodeProcess failed: %lu
AI-assisted analysis of openjdk/jdk@88dfb74bbe (2026-08-14).
Data as JSON: /api/errors/acbdb56e7a8e7b92.
Report an issue: GitHub.