keytool error: java.io.FileNotFoundException: C:\AndroidWorkspace\androidKey\public.jks (The system cannot find the path specified)

Windows path might be the problem

 keytool -genkey -v -keystore c:\key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

Use a path like above where the slash used is backward slanting.


On windows if you are trying to generate the key using the cmd and copying the command from the android docs which is the following:

keytool -genkey -v -keystore c:\Users\USER_NAME\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key

you need to change the USER_NAME part to what ever is your PC name which is a folder name in the users folder and then execute the code. For example if my users folder name is Taba then I have to execute this code:

keytool -genkey -v -keystore c:\Users\Taba\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key

Or you can even change the directory to where ever you like the .jks file to be saved.