Is there a single command I can run to find all jd...
# random
c
Is there a single command I can run to find all jdks on my machine... INCLUDING the jdks that come with intellij/android studio? my reasoning being that i need to install a cacert into each jdk. would love to automate it with a script.
k
That sounded like an interesting idea so I tried it, but it didn't find everything. I have Open JDK 17, the Ubuntu distribution (
apt install openjdk-17-jdk
), which creates the JDK in
/usr/lib/jvm/java-17-openjdk-amd64/
and also creates directory
/usr/lib/jvm/openjdk-17/
containing directory symbolic links to the real
bin
etc directories. I also have other versions of the JDK under my home directory. The gradle command found only the two directories in
/usr/lib/jvm
but didn't find the ones under my home directory. It also considered those two directories in
/usr/lib/jvm
as if they were two separate installations, instead of being just one. The Gradle documentation says something about custom toolchains, but it seems you have to tell Gradle where those custom toolchains are, which defeats the purpose. I think it would be more reliable to just use the
find
command.
c
the find command seems to also find the jdk packaged with compose desktop apps lol. so i had to opt out of those. but let me try ephemients method to see if that helps.
oooh. found
/usr/libexec/java_home -V
also works nicely on mac.
did a mac update (a . release, not the latest major release) and now both my command and @ephemient do not list android studios built in jdk. hmmmmmmm. back to square one it seems?
r
This old issue I had with
java_home
might be relevant https://stackoverflow.com/questions/76523553
👀 1