bete24
April 24, 2023, 10:55am
1
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
mbonn
April 24, 2023, 1:15pm
2
Seems to be a problem with spaces in the default C:\Program Files\path\to\java.exe
opened 11:08AM - 19 Apr 23 UTC
closed 07:00AM - 26 Apr 23 UTC
kind/bug
area/dist/quarkus
team/cloud-native
### Before reporting an issue
- [X] I have searched existing issues
- [X] I hav… e reproduced the issue with the latest release
### Area
dist/quarkus
### Describe the bug
Executing `.\kc.bat start-dev` failed with the following error:
```
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
```
### Version
21.1.0
### Expected behavior
It should run without errors
### Actual behavior
It fails to run
### How to Reproduce?
Execute `.\kc.bat start-dev` on Windows
### Anything else?
Most likely caused by this change https://github.com/keycloak/keycloak/commit/1c9992fdaeff9566fd8f734ec5fdbf82c7fb5720
keycloak:main ← Pepo48:fix-win-base-tests-timeout
opened 10:44PM - 15 Apr 23 UTC
* reverted keycloak/keycloak@ca9c6dd (Ant's configure.xml changes)
* edited kc.… bat to prevent 'C:\Program' is not recognized as a command error (Ant BuildException)
* fixed the internal pipeline build errors
Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
The timeout issue was caused by the recent cleanup of kc.bat (#16229), where the majority of the double quote encapsulation was removed. This typically may cause a problem, when there is a space in a path of a binary (in this case java.exe). Therefore, at least `%JAVA%` variable should stay enquoted (the binary is by default placed into Program Files, so the path may contain a space).
I also used this PR as an opportunity to get rid of a warning about the usage of the unix file separators.
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:
JAVA_HOME = c:\Program Files\Java\jdk-11 or higher
add "c:\keycloak-21.1.0\bin" to PATH variable
1 Like
Mounif
September 18, 2024, 12:25pm
4
Just change “%JAVA%” to “%JAVA%\java” in the script “kc.bat”