Take a look at Prometheus's HTTPServer class:
https://github.com/prometheus/client_java/blob/master/simpleclient_httpse...
This Prometheus HTTPServer class is what jmx exporter uses for its metrics endpoint -
see:
https://github.com/prometheus/jmx_exporter/blob/master/jmx_prometheus_jav...
https://github.com/prometheus/jmx_exporter/blob/master/jmx_prometheus_htt...
Since it uses com.sun.net.httpserver classes under the covers, I'll assume this rules
out support for, say, IBM's JVM (does IBM's JRE implement these?). I think this is
available on OpenJDK but didn't check to make 100% sure.