Reputation: 327
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.
Upvotes: 15
Views: 20712
Reputation: 4555
/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
Upvotes: 21
Reputation: 1923
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.
Upvotes: 2