[COOK-2904] - add helper for returning java path

Add a helper in libraries/ to determine the correct location for the
java installation so `update-alternatives` can detect the right place.

This doesn't use any shell globbing and instead uses the fact that the
path is "standardized" (see COOK-2904) across Debian and RHEL
platforms.