无法将"keytool"识别为内部或外部命令 [英] 'keytool' is not recognized as an internal or external command

查看:676
本文介绍了无法将"keytool"识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Ionic创建了一个小型Android应用程序,并且打算构建签名的APK来测试该应用程序.

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

当我在命令提示符下键入'keytool'命令时,出现此错误

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

"keytool"未被识别为内部或外部命令, 可操作的程序或批处理文件.

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

我尝试使用谷歌搜索,所有解决的问题都提到这与JDK的Path变量有关. 我尝试将'JAVA_HOME'变量值更改为'C:\ Program Files \ Java \ jdk1.8.0_131 \ bin'并更改为'C:\ Program Files \ Java \ jre1.8.0_131 \ bin',仍然出现相同的错误.

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.

但是当我运行'keytool'命令时,它在cmd 'C:\ Program Files \ Java \ jre1.8.0_131 \ bin'位置运行.

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 ?

推荐答案

之所以会发生这种情况,是因为您没有在%PATH%中添加JAVA_HOME环境变量的 bin 目录.

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

  1. 添加环境变量JAVA_HOME,其路径为 C:\ Program Files \ Java \ jdk1.8.0_131 ,而没有 bin 目录.
  2. %PATH%末尾添加%JAVA_HOME%\bin目录.
  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%.

这篇关于无法将"keytool"识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆