当我 运行 keytoll for get keyrelease 显示这个错误

When I run keytoll for get keyrelease display this error

1-运行 powersell in C:\Program Files\Java\jdk1.8.0_191\bin

keytool.exe exist

2-运行

keytool -genkey -v -keystore release-key.keystore -alias key-alias -keyalg RSA -keysize 2048 -validity 10000

但显示此错误:

keytool : The term 'keytool' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ keytool -genkey -v -keystore d:\release-key.keystore -alias key-alias ...
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (keytool:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

建议[3,一般]:未找到命令keytool,但在当前位置确实存在。 Windows 默认情况下,PowerShell 不会从当前位置加载命令。如果您信任此命令,请键入:“.\keytool”。有关详细信息,请参阅 "get-help about_Command_Precedence"。

可以有两种解决方案,

  1. 转到 Java\jdk1.8.0_191\bin 目录并在那里打开 cmd 或 powershell 然后 运行 你的命令
  2. 您需要在系统环境的路径变量中设置Java\jdk1.8.0_191\bin路径

    编辑

实际上 keytool 位于 jre 文件夹中,而不是 jdk。

所以检查这个,

  1. 转到 Java\jre1.8.0_191\bin 目录并在那里打开 cmd 或 powershell 然后 运行 你的命令
    1. 您需要在系统环境的路径变量中设置Java\jre1.8.0_191\bin路径

并确保在使用第一个解决方案时使用 .\keytool.exe 而不是 keytool