Coming from Windows, you can easily add Android Studio's JRE now JBR directory in environment variable path where executable such as jarsigner and keytool are located. I tried to do the same in macOS but using symlink as the suggested method I am seeing in the web.
First I copied the directory to my clipboard
/Applications/Android Studio Preview.app/Contents/jbr/Contents/Home/bin
Then followed this SO answer and executed the below command
sudo ln -s /Applications/Android Studio Preview.app/Contents/jbr/Contents/Home/bin /usr/local/bin
I already echoed $PATH
and found usr/local/bin
so I skipped the mkdir part.
Unfortunately it does not work and seems broken.
This is what I am seeing
user@User-MacBook-Pro ~ % ls -la /usr/local/bin/
total 354896
drwxr-xr-x 9 root wheel 288 Aug 9 02:31 .
drwxr-xr-x 6 root wheel 192 Aug 8 01:12 ..
lrwxr-xr-x 1 root wheel 21 Aug 9 02:31 Android -> /Applications/Android
lrwxr-xr-x 1 root wheel 6 Aug 9 02:31 Studio -> Studio
lrwxr-xr-x 1 root wheel 42 Aug 9 02:31 bin -> Preview.app/Contents/jbr/Contents/Home/bin
lrwxr-xr-x 1 root wheel 45 Aug 8 02:39 corepack -> ../lib/node_modules/corepack/dist/corepack.js
-rwxr-xr-x 1 root wheel 181706736 Jul 18 20:09 node
lrwxr-xr-x 1 root wheel 38 Aug 8 02:39 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxr-xr-x 1 root wheel 38 Aug 8 02:39 npx -> ../lib/node_modules/npm/bin/npx-cli.js
What went wrong and how to fix it?