"keytool" is not recognized as an internal or external command, program or batch file executable

2

I am trying to implement Firebase in my Android Studio application and since I want to use Firebase Auth I need the SHA-1 signature certificate, and to get it I need to execute this code in the CMD:

keytool -exportcert -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore

But I get it: "keytool" is not recognized as an internal or external command, program or batch file executable. And that already try doing cd in the .android folder and java is already in the path and already add the variable JAVA_HOME.

What do I do?

    
asked by isalvinator 06.08.2017 в 07:06
source

2 answers

3

The problem you are discussing

  

"keytool" is not recognized as an internal or external command, program   or executable batch file

It is because where you try to execute keytool does not really exist, if the directory is not defined in the environment variables in windows you simply can not access it from any folder, it ensures the path is correctly defined (When you define a environment variable in the current versions of Windows it seems to me that you do not need a restart of your pc, but it could be an option).

If you ensure that the path defined is the correct one in the variable %JAVA_HOME% , make the change to your directory in the command line in this way

cd %JAVA_HOME%\bin

Remember that keytool is in the \bin directory, later

perform the operation you want

keytool -exportcert -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
    
answered by 06.08.2017 / 19:59
source
1

In my case -using windows 10 and PowerShell- I had to add " ./ " at the start of the command, like this:

./keytool -exportcert -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
    
answered by 25.03.2018 в 23:52