There are a couple of functions in src/java.base/unix/native/libnet/NetworkInterface.c which try to create IPv4 sockets, then check if errno is EPROTONOSUPPORT. If errno is EPROTONOSUPPORT, then IPv6 is tried, else it immediately bails.
We have a kernel that returns EAFNOSUPPORT when IPv4 is disabled and there is an attempt to create an AF_INET socket.
We have a kernel that returns EAFNOSUPPORT when IPv4 is disabled and there is an attempt to create an AF_INET socket.