mkcert: Executable not found in path

I tried running mkcert version 1.1.0 in windows. I got the following error.

$ mkcert-v1.1.0-windows-amd64.exe example.org Using the local CA at "C:\Users\XXXXX\AppData\Local\mkcert" ERROR: failed to execute "keytool -list": exec: "": executable file not found in %PATH%

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 28 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I had the same issue today on Mojave.

I ended up manually running keytool to kick it into action by doing keytool -genkeypair which fixed the keytool error: java.lang.Exception: Keystore file does not exist error.

However then still had the odd JAVA_HOME issue - I used a pretty dodgy workaround and added an bash alias of alias mkcert="unset JAVA_HOME && mkcert"

So just for that terminal session it would unset it - and it seems to then work!

mkcert-v1.1.0-windows-amd64.exe -install
Using the local CA at "C:\Users\XXXXX\AppData\Local\mkcert" ✨
The local CA is now installed in the system trust store! ⚡️
Note: Firefox support is not available on your platform. ℹ️
ERROR: failed to execute "keytool -list": exec: "": executable file not found in %PATH%

keytool -list
keytool error: java.lang.Exception: Keystore file does not exist: C:\Users\alexa\.keystore

I just deleted JAVA_HOME env var and it just worked like a charm. Thanks!

unset JAVA_HOME did the trick for me

For Windows installation, you can use those commands:

REM Define %JAVA_HOME% variable
    for /d %%i in ("\Program Files\Java\jdk*") do set JAVA_HOME=%%i

REM Add %JAVA_HOME% VARIABLE to %PATH% variable
    setx PATH "%JAVA_HOME%\bin";"%PATH%" -m

To be clear, when JAVA_HOME is set, both the Java and the system trust stores have the certificate installed. Would you still want to selectively disable that, even if this issue was fixed? If so, please open a separate issue for that feature request.

Yep. I missed that before, sorry. I don’t have a windows machine to test with, but could y’all try this patch?

https://github.com/FiloSottile/mkcert/pull/54

I’m having the same issue and getting the same response as @aprasadh from "%JAVA_HOME%\bin\keytool.exe" -list as well as keytool -list. This isn’t something I recall having to do for mkcert on macos or ubuntu.