Published on: 20 Sep, 2016

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

Tumblr Digg Google Plus

If it is your first time learning to build android project, you may find an issue when try to generate a private key. This message keytool is not recognized as an internal or external command, operable program or batch file. may occur if the path of your java sdk has not been set globally.

There are two options you can do, the first easy option is by set the path of sdk java globally so you can run any executable file from the bin java folder. Click the window button and type in Environment Variables in the search program field bar.

A popup window will appear, there will be a button called Environment Variables

.

Click this button and look for the Path value in the System variables panel and then click the edit button. Enter your java sdk location at the end of the path value. Once you add this you should be able to use the keyword keytool.exe. For example the path of java SDK install can be like this.

C:\Program Files\Java\jdk1.7.0_79\bin

There will be a list of path entered this field, so make sure before you enter the path for the java sdk you enter a semicolon first.

The second option is to directly point the path of the keytool to java sdk installation folder, which in this case would be: C:\Program Files\Java\jdk1.7.0_79\bin.

Hopefully this helps for everyone that want to try developing mobile using Ionic and Cordova.

Comments

Sea Rothert
05 Feb, 2017
In my case: I had to add a \ after bin for this to work
Mounika
15 Jun, 2018
For me too :) Thanks!
Abdelfettah
23 Aug, 2018
It's very helpful, good job bro
Dwi Kurniawan
06 Jul, 2019
Thank you so much
Sourabh Biswas
04 May, 2020
A simple solution of error is that you first need to change the folder directory in command prompt. By default in command prompt or in terminal(Inside Android studio in the bottom)tab the path is set to C:\Users\#Name of your PC that you selected\AndroidStudioProjects\#app name\flutter_app> **Change accordingly:-** C:\Users\#Name of your PC that you selected\AndroidStudioProjects\#app name\flutter_app>cd\ # type **cd\** (#after flutter_app>), type only cd\ not comma's #then type cd **Program Files\Java\jre1.8.0_251\bin** (#remember to check the file name of jre properly) #now type **keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android** (without anyspace type the command).
Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.