PortGroup java is useful for Java packages.
Portfiles using the java PortGroup allow for port authors to set the following keywords in addition to the general Portfile keywords.
This keyword indicates that the port requires a Java installation of the specified version. If no such installation can be located, and no fallback option is specified (see below), the port will fail at the pre-fetch phase.
The version string can indicate a specific version or a range with wildcards "+" and "*". Note that Java 8 and earlier are "1.8", etc., while Java 9 and later are "9", etc.
Example:
java.version 1.8+
This keyword indicates an (optional) port dependency that will be added to the ports 'depends-lib' list in the case a prior installation of Java satisfying the requested version can not be found.
Example:
java.fallback openjdk10