keytool is unable to find the Java runtime
See original GitHub issueI was giving BubbleWrap a try by running commands from this page https://web.dev/using-a-pwa-in-your-android-app/#bubblewrap
npx @bubblewrap/cli init --manifest=https://pwa-directory.appspot.com/manifest.json
Then, I realized I needed to set up JDK. To do that, I followed the steps on https://github.com/GoogleChromeLabs/bubblewrap/tree/master/packages/cli
- Download a version of JDK 8 that is compatible with your OS from AdoptOpenJDK and extract it in its own folder. https://adoptopenjdk.net/releases.html?variant=openjdk8&jvmVariant=hotspot
I downloaded OpenJDK 8
- I downloaded CLI tools https://developer.android.com/studio#command-tools
After unzipping, I have these folders
I have these in my llama-pack-config.json
{
"jdkPath":"/Users/jun/Downloads/jdk8u252-b09",
"androidSdkPath":"/Users/jun/Downloads/tools"
}
When I ran npx @bubblewrap/cli init --manifest=https://pwa-directory.appspot.com/manifest.json
, I got this error.
Error message:
cli ERROR Command failed: keytool -genkeypair -dname "cn=JD, ou=Eng, o=C, c=CA" -alias "./android.keystore" -keypass "123456" -keystore "./android.keystore" -storepass "123456" -validity 20000 -keyalg RSA
No Java runtime present, requesting install.
folder access
-rw-r--r--@ 1 jun staff 96M 14 Jul 17:19 OpenJDK8U-jdk_x64_mac_hotspot_8u252b09.tar.gz
-rw-r--r--@ 1 jun staff 83M 14 Jul 17:19 commandlinetools-mac-6609375_latest.zip
drwxr-xr-x@ 3 jun staff 96B 22 Apr 01:54 jdk8u252-b09
drwxr-xr-x@ 6 jun staff 192B 14 Jul 17:21 tools
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Even though JRE 8 is installed on my MAC -" No Java ...
For example, when I do apt update I get the error The operation couldn't be completed. Unable to locate a Java Runtime that...
Read more >How to solve “Unable to locate a Java Runtime that supports ...
Try to run caver_analyst with the --jdkhome switch, followed by (I guess) the path to a valid JDK as suggested in your error...
Read more >Java Runtime not found | Apple Developer Forums
Today it can't find Java. Research says to check the Java icon in the System Preferences. But there is no Java icon in...
Read more >'keytool' is not recognized as an internal or external command
This step-by-step guide shows how to install keytool and add it to your system PATH on Windows and macOS.
Read more >[Solved] Error: Could not find Java SE Runtime Environment
1. Go to "Programs and Features" and uninstall all the previous java versions. Check the location "C:/Program Files/..." and delete ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a bug. The file should have been created at
./pwa-android
Unfortunately, unzip the Android command-line tools from the UI ends up unzipping it to the current folder, because the zip file only contains the
/tools
folder. But, as you noticed, the SDK downloads more files and adds them to the same folder level astools
. So, I’d recommend unzipping the files to anandroid-sdk
folder and pointing to that.licence
,build-tools
,platform-tools
, etc are part of the Android command-line tools (and it’s that tool that creates them), not the Android project. They are indeed created in the “right” place.You may be interested in the flow here: https://www.youtube.com/watch?v=QJlbMfW3jPc
Updated README.md