I have figured out a way to make this a permanent change from here.
What you need to do is add a system variable named JAVA_TOOL_OPTIONS and set this to whatever you want to be passed to java as a commandline argument whenever it starts up, in yours and my case being
-Djava.net.preferIPv4Stack=true