在C:\ Program Files \ Java \ jdk1.8.0_191 \ bin中运行1个powersell
keytool.exe存在
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”。
可以有两种解决方案,
实际上keytool驻留在jre文件夹中而不是jdk中。
所以检查一下,
并确保当你使用第一个解决方案时使用.\keytool.exe
而不是keytool