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.
The message “Unable to load Java Runtime Environment” means that the Mac computer cannot load JRE, either because it is out of date or (more usually) because it has not yet been downloaded and installed. It can also happen after the computer OS X has been updated, e.g. to 10.14 Mojave from 10.13 Maverick.
Mac OS X 10.7. 3 and above: Under System Preferences click on the Java icon to access the Java Control Panel which will list your Java version. If you do not see a Java icon under System Preferences, Java 7 or later versions is not installed.
/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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With