title: How to set java.net.preferIPv4Stack=true at runtime?
body: <p>I need to disable IPv6. For that the java documentation indicates setting jvm property <code>java.net.preferIPv4Stack=true</code>.</p>
  
  <p>But I don't understand how to do it from the code itself.</p>
  
  <p>Many forums demonstrated doing it from the command prompt, but I need to do it at runtime.</p>