15

I am trying to generate keystore file using following command.

keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

But getting following error.

No Java runtime present, requesting install.

I develop app using flutter and create APK for android, I am following below link https://flutter.io/android-release/

I don't know how to resolve this. So please help me.

2 Answers 2

22
/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

Running this command should be okay. Just tested with the latest MacOS.

Note: make sure you have installed Android Studio

Sign up to request clarification or add additional context in comments.

5 Comments

/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool -alias androiddebugkey -keystore ~/.android/debug.keystore for debug
when attempting to run the command I get a "No such file or directory"... (?)
@BrianBarcelona have you installed Android Studio? (+ jdk and jre)?
@atereshkov no... I haven´t... a pointer would be useful... thanks for your comment!
Thanks, some explanation for this command would be a huge help pls.
2

You have to install Java (Runtime) in your system as Android requires the same.

Follow below steps given in the links and try to run again.

https://java.com/en/download/help/mac_install.xml

When you are generating Flutter to Android apk. What is actually happening is your code is getting converted to android code and android requires java so that's why it's complaining for java.

I hope this helps.

2 Comments

I already installed Android Studio. And I am getting Java binary at this path : /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
tru to run java -version on cmd and looks the output if it shows the java version then okey else you need to set the path to enviornment variables(PATH & JRE_HOME).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.