Command prompt launches "java.exe" with .exe extension, but not without .exe extension

The path was well defined. I solved my problem by adding .EXE to the PATHEXT environment variable.

Thanks a lot guys for your answers


This issue also happens if your user PATHEXT variable overrides the system PATHEXT variable, without extending the system PATHEXT variable

Prefix the %PATHEXT% variable in your user PATHEXT variable to solve this problem.

enter image description here