Unable to start keycloak 21.1.0 on windows with kc.bat

Hi All,

When we are trying to run bin/kc.bat start-dev it raises this error:
‘C:\Program’ is not recognized as an internal or external command,
operable program or batch file.

1 Like

Seems to be a problem with spaces in the default C:\Program Files\path\to\java.exe

You can try to install Java in a path without spaces or wait for the next Keycloak release, which should fix it.

2 Likes

Hello
maybe you need to write in environment variables:

  1. JAVA_HOME = c:\Program Files\Java\jdk-11 or higher
  2. add "c:\keycloak-21.1.0\bin" to PATH variable
1 Like

Just change “%JAVA%” to “%JAVA%\java” in the script “kc.bat”