On Dec 12, 2021, at 19:10, Christopher Chavez wrote: >> And shouldn’t ports that use java not depend on a java that comes with (old, >> outdated) java’s in macOS? But install and use an open source version >> instead? Or use the one from Oracle if available? > > Because JDK is not a lightweight dependency, it seems somewhat desirable for > ports to be flexible when specifying a Java requirement, and allow using an > already-installed JDK/JRE if compatible (including one not provided by > MacPorts). The Java PortGroup allows specifying a required Java version > (either a minimum version or an exact version), and a fallback JDK port to > install if a compatible version isn’t already present (hopefully an LTS > version: e.g. 8, 11, or 17 from OpenJDK; other vendors may have LTS for other > versions).
The java portgroup and the ability to install java by using MacPorts are relatively new capabilities. Not that long ago, everything in MacPorts that required java required the user to have installed it manually first. This made sense back when java was provided with the OS, but as you say that hasn't been the case for over a decade. Probably not all java-using ports have yet been updated to use the java portgroup, with I'm not sure what consequences.