当我运行keytoll获取keyrelease时显示此错误

问题描述 投票:3回答:1

在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”。

android react-native keytool
1个回答
1
投票

可以有两种解决方案,

  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并运行命令 您需要在系统环境的路径变量中设置Java \ jre1.8.0_191 \ bin路径

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

© www.soinside.com 2019 - 2024. All rights reserved.