錯誤:“keytool”不能識別為內部或外部命令、可操作程序或批處理文件

[英]ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file


When i use the command

當我使用命令時

C:\>keytool -list -alias androiddebugkey 
            -keystore .android\debug.keystore 
            -storepass android -keypass android

I get this error:

我得到這個錯誤:

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

“keytool”不被識別為內部或外部命令、可操作程序或批處理文件。

I'm not able to get the certificate fingerprint(MD5) on my computer.

我在電腦上找不到證書指紋(MD5)。

i have ensured that the keystore file is present in the appropriate location.

我已經確保密鑰存儲文件位於適當的位置。

Any help?

任何幫助嗎?

15 个解决方案

#1


169  

Check that the directory the keytool executable is in is on your path. (For example, on my Windows 7 machine, it's in C:\Program Files (x86)\Java\jre6\bin.)

檢查keytool可執行文件所在的目錄是否在您的路徑上。(例如,在我的Windows 7的機器,它在C:\Program Files (x86)\Java\jre6\本)。

#2


72  

This worked for me !! :

這對我起作用了!!:

Go to this path or where ever you have your keytool.exe file

到這條路徑或者你有鑰匙工具的地方。exe文件

C:\Program Files\Java\jre7\bin

Hold shift and right click -> then press Open command window here

按住shift鍵,右擊->,然后點擊這里的“打開命令”窗口

terminal will pop up, paste this in:

終端會彈出,粘貼到:

keytool -list -v -keystore "C:\Users\"Your-User-Name(no quotes)"\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

gives you both MD5 and SHA1

同時給出MD5和SHA1

#3


50  

Found it.

找到了。

GO TO:

至:

my computer->rightClick->properties->Advanced system settings->environment variables->find path in system variables->dbl click-> paste the "C:\Program Files\Java\jdk1.6.0_16\bin"->OK

GO TO:

至:

cmd -> keytool -list -alias androiddebugkey -keystore "C:\Users\meee\.android\debug.keystore" -storepass android -keypass android

#4


8  

On windows 8, go to C:\Program Files\Java\jre7\bin and in the address bar, type "cmd" without the quotes. This will launch the terminal. Then type in string as describe here.

在windows 8,去C:\Program Files\Java\jre7\bin在地址欄,輸入“cmd”沒有引號。這將啟動終端。然后輸入字符串,在這里描述。

#5


5  

all you can do is to navigate to your jre destination in your computer via command line and then once you reach bin, you type the keytool command and it would work.

您所能做的就是通過命令行導航到您的計算機中的jre目的地,然后一旦到達bin,您輸入keytool命令,它就會工作。

C:\Program Files (x86)\Java\jre7\bin>
C:\Program Files (x86)\Java\jre7\bin>keytool -list -v -keystore"%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android



Alias name: androiddebugkey
Creation date: 23 Feb, 2014
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 479d4fe7
Valid from: Sun Feb 23 06:19:02 IST 2014 until: Tue Feb 16 06:19:02 IST 2044
Certificate fingerprints:
MD5:  DB:6A:8E:48:22:5B:37:73:B1:91:EF:43:3F:26:F0:EC
SHA1: B4:6B:2E:5F:5A:30:C5:E4:E7:12:BB:F0:74:FC:2B:43:64:3A:FC:15
SHA256: CB:59:F3:20:7D:5B:87:99:6C:0D:32:79:79:CF:4E:8C:16:C2:37:81:7B:
B0:AF:D2:EC:3C:11:21:53:58:62:F6
Signature algorithm name: SHA256withRSA
Version: 3
Extensions:
#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: FA 96 17 9E 94 73 C3 42   F0 4B 55 5B C7 5B EE BB  .....s.B.KU[.[..
0010: C3 E5 D3 61                                        ...a
]
]

#6


5  

So if you have the following structure now:

如果你現在有以下結構:

 C:\Program Files\Java\jre6\bin\
                                keytool.exe
                                debug.keystore

then execute:

然后執行:

C:\Program Files\Java\jre6\bin>keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android 

#7


4  

Make sure JAVA_HOME is set and the path in environment variables reflects the bin directory of JAVA_HOME. Basically, the PATH should be able to find the keytools.exe file in your jdk location.

確保設置了JAVA_HOME,環境變量中的路徑反映了JAVA_HOME的bin目錄。基本上,路徑應該能夠找到關鍵工具。在您的jdk位置上的exe文件。

#8


2  

This means, that your shell couldn't find the tool on your harddisk.

這意味着,您的shell無法找到硬盤上的工具。

A)

一)

  • Change the working directory to C:\Program Files\Java\jre6\bin\
  • 改變工作目錄C:\Program Files\Java\jre6\bin\
  • Execute keytool -list -alias androiddebugkey keystore <full directory name make sure that you use enclosing in quotes> -storepass android -keypass android
  • 執行keytool -list -別名androiddebugkey keystore <完整目錄名確保您使用了引號> -storepass android -keypass android中的封閉

B)

B)

  • Add C:\Program Files\Java\jre6\bin\ to your PATH variable
  • C:\Program Files\Java\jre6\bin\添加到您的PATH變量

#9


2  

if you want to run keytool from any location of terminal

如果您想從終端的任何位置運行keytool。

example: C:>keytool

例如:C:> keytool

you need to add the system variables

您需要添加系統變量

for Windows:

Windows:

1) create:
JAVA_HOME
C:\Program Files\Java\jdk1.7.0_45

2) add to Path
%JAVA_HOME%\bin;

#10


1  

Give:

給:

keytool -list -keystore ~/.android/debug.keystore

Also in your line there is a space in keystore. Please check it.

在你的行中還有一個空格在keystore中。請檢查它。

#11


1  

Easy, just find the location where keytool executable is, normally is in java/jre(Version)/bin forexample in my computer is in C:\Program Files\Java\jre7\bin. all you have to do is go to environment variables, click PATH to make it active, then click edit, then add complete path where your keytool is, for me i will add C:\Program Files\Java\jre7\bin this will allow you to execute keytool commands without going to the directory where keytool is installed.

簡單,只是發現keytool可執行文件的位置,通常是在java / jre(版本)/ bin C:\Program Files\Java\jre7\bin.例如在我的電腦所有你要做的就是去環境變量,單擊路徑,使其活躍,然后單擊編輯,然后添加你的keytool是完整路徑,對我來說,我將添加C:\Program Files\Java\jre7\bin這將允許您執行keytool命令沒有keytool安裝的目錄。

#12


0  

The Works for fine

適用於細

Go to Path

去的路徑

C:\Program Files\Java\jre7\bin> keytool -exportcert -alias androiddebugkey -keystore "C:\Users\Developer\.android\debug.keystore"

Then enter Ketsore Password and job done!!

然后輸入Ketsore密碼和工作完成!!

#13


0  

Open Command prompt type this..

打開命令提示符輸入。

"c:\Program Files(x86)\Java\jdk1.7.0\bin\keytool.exe" -list -v -alias androiddebugkey -keystore "C:\Users\EIS.android\debug.keystore" -storepass android -keypass android

“c:\ Program Files \ Java \(x86)jdk1.7.0 \ bin \ keytool。exe“-list -v -別名androiddebugkey -keystore”C:\Users\EIS.android\debug。keystore" -storepass android -keypass android

Then Hit Enter MD5 and SHA1 key will get

然后點擊進入MD5, SHA1將會得到

#14


0  

I know there are already several answers but none of them worked for me, so i am posting one that worked for me, may be helpful for someone.

我知道已經有好幾個答案了,但是沒有一個是對我有用的,所以我把一個對我有用的,可能對一個人有用。

First of all directory to keytool.exe must be on path

首先從所有目錄到keytool。exe必須在路徑上

and if instead of directory being on path it is giving error then Try starting command line as a normal user instead of as a administrator or changing the directory to home directory

如果不是路徑上的目錄出錯,那么嘗試以普通用戶的身份啟動命令行,而不是作為管理員或將目錄更改為home目錄

#15


0  

For windows 10 you need to path C:\Program Files\Java\jre1.8.0_161\bin

windows 10你需要路徑C:\Program Files\Java\ jre1.8.0_161 \ bin

restart command and open

重啟命令和開放


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2011/06/02/72a24fd8cef89fec271c9b7587b1f4f0.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com