Java looks for an actual display plugged into the Mac mini in order for it to install without error. None of the Mac servers in a data center environment like at MacStadium have physical displays connected.
As a solution, we have verified that installing a GPU enabler dongle — which we include as a free add-on to all Mac subscriptions — will trick macOS1 into thinking that there is a display plugged in. Java will once again install without error. Other benefits of the GPU enabler dongle such as performance improvements and increased resolutions available noted in articles on our blog.