I am trying to discover the list of trusted authorities in my Java Runtime using the instructions in this article. When I typed the command below:
C:\\ColdFusion
Run the cmd as run as administrator this worked for me
Execute following command:
set PATH="C:\Program Files (x86)\Java\jre7"
(whichever JRE
exists in case of 64bit).
Because your Java Path is not set so you can just do this at command line and then execute the keytool
import command.
I finally solved the problem!!! You should first set the jre path to system variables by navigating to::
control panel > System and Security > System > Advanced system settings
Under System variables click on new
Variable name: KEY_PATH
Variable value: C:\Program Files (x86)\Java\jre1.8.0_171\bin
Where Variable value should be the path to your JDK's bin folder.
Then open command prompt and Change directory to the same JDK's bin folder like this
C:\Program Files (x86)\Java\jre1.8.0_171\bin
then paste,
keytool -list -v -keystore "C:\Users\user\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
NOTE: People are confusing jre and jdk. All I did applied strictly to jre
Make sure JAVA_HOME is set and the path in environment variables. The PATH should be able to find the keytools.exe
Open “Windows search” and search for "Environment Variables"
Under “System variables” click the “New…” button and enter JAVA_HOME as “Variable name” and the path to your Java JDK directory under “Variable value” it should be similar to this C:\Program Files\Java\jre1.8.0_231
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\
screenshot of the codes to run
Add your JDK's /bin folder to the PATH
environmental variable. You can do this under System settings > Environmental variables, or via CLI:
set PATH=%PATH%;C:\Program Files\Java\jdk1.7.0_80\bin
Close and reopen your CLI window