0

I am trying to run keytool command on my newly setup mac with M1 chip, however navigating in /Applications/Android Studio Preview.app/Contents/jbr/Contents/Home/bin then open the folder with terminal to run a keytool command does not work and giving me an error

The operation couldn’t be completed. Unable to locate a Java Runtime. Please visit http://www.java.com for information on installing Java.

This does not happen in Windows, I am expecting that I no longer need to install JRE since Android Studio itself already have it.

But opening the actual keytool executable seems working

Bitwise DEVS
  • 2,858
  • 4
  • 24
  • 67
  • 1
    Do you have JAVA_HOME set up? https://stackoverflow.com/questions/22842743/how-to-set-java-home-environment-variable-on-mac-os-x-10-9 might help – Viktor Yakunin Aug 08 '23 at 19:53
  • What exact command causes this error? Is `java` and `javac` on your `PATH`? – Code-Apprentice Aug 08 '23 at 19:53
  • @Code-Apprentice keytool and jarsigner, probably everything in the bin folder that has something to do with Java – Bitwise DEVS Aug 08 '23 at 19:55
  • So you just type `keytool` and then get this error? Just one example is enough for now. – Code-Apprentice Aug 08 '23 at 19:55
  • @ViktorYakunin probably not as I am just starting to build my setup, however in Windows I do not need to specify the JAVA_HOME and still works. Any idea why is that possible? – Bitwise DEVS Aug 08 '23 at 19:58
  • @Code-Apprentice correct, it should show what action is available with keytool command but I am getting the above error instead of those action list. – Bitwise DEVS Aug 08 '23 at 19:59

0 Answers0