'keytool' is not recognized as an internal or external command [duplicate]

左心房为你撑大大i 提交于 2020-05-30 11:31:31

问题


I've created a small Android application using Ionic and I was going to build the signed apk to test the app.

When I typed 'keytool' command in my command prompt I'm getting this error

'keytool' is not recognized as an internal or external command, operable program or batch file.

And I tried googling and all solved problems mentions that it's a problem with Path variable of JDK. I tried changing my 'JAVA_HOME' variable value to 'C:\Program Files\Java\jdk1.8.0_131\bin' and to 'C:\Program Files\Java\jre1.8.0_131\bin' and still getting the same error.

But when I run the 'keytool' command it the cmd 'C:\Program Files\Java\jre1.8.0_131\bin' location, it works.

Can anyone help me with this ? What might be a problem that I can't access it globally ?


回答1:


That happens because you haven't added the bin directory of your JAVA_HOME environment variable in your %PATH%.

  1. Add the environment variable JAVA_HOME with path C:\Program Files\Java\jdk1.8.0_131 without the bin directory.
  2. Add the %JAVA_HOME%\bin directory at the end of your %PATH%.


来源:https://stackoverflow.com/questions/43720147/keytool-is-not-recognized-as-an-internal-or-external-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!