How do you check if Java SDK is installed on a Mac?
Is there a command line for this?
/usr/bin/java_home tool returns 1 if java not installed.
/usr/bin/java_home
So you can check if java is installed by the next way:
/usr/libexec/java_home &> /dev/null && echo "installed" || echo "not installed"