buildlink2.mk file creates a public variable "BUILDLINK_JAVA_PREFIX.<pkg>" that may be used as the JAVA_HOME for that package.