Can I set some parameter for prefer ipv4 instead of ipv6 on server.properties?

By default server starts on ipv6 interfaces, but with parameter -Djava.net.preferIPv4Stack=true it starts on ipv4, can I set to prefer ipv4 on server.properties config file?

It is starts on both IPv6 and IPv4. Doesn’t IPv4 works for you by default?

Yes, I tested on synology and Ubuntu 16.04 OS.

[~]$ java -jar server-0.16.4.jar &
[~]$ netstat -nlp | grep java
tcp6       0      0 :::8080                 :::*                    LISTEN      47506/java
tcp6       0      0 :::8081                 :::*                    LISTEN      47506/java
tcp6       0      0 :::8082                 :::*                    LISTEN      47506/java
tcp6       0      0 :::7443                 :::*                    LISTEN      47506/java
tcp6       0      0 :::8441                 :::*                    LISTEN      47506/java
tcp6       0      0 :::8442                 :::*                    LISTEN      47506/java
tcp6       0      0 :::8443                 :::*                    LISTEN      47506/java
tcp6       0      0 :::9443                 :::*                    LISTEN      47506/java

[~]$ java -Djava.net.preferIPv4Stack=true -jar server-0.16.4.jar &
[~]$ netstat -nlp | grep java
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      7220/java
tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      7220/java
tcp        0      0 0.0.0.0:8082            0.0.0.0:*               LISTEN      7220/java
tcp        0      0 0.0.0.0:7443            0.0.0.0:*               LISTEN      7220/java
tcp        0      0 0.0.0.0:8441            0.0.0.0:*               LISTEN      7220/java
tcp        0      0 0.0.0.0:8442            0.0.0.0:*               LISTEN      7220/java
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN      7220/java
tcp        0      0 0.0.0.0:9443            0.0.0.0:*               LISTEN      7220/java

Yes it doesn’t work? Did you try to connect without -Djava.net.preferIPv4Stack=true?

Yes, it doesn’t work on ipv4 by default. As you can see in my output when I run server without -Djava.net.preferIPv4Stack=true it runs only on ipv6 (tcp6 on netstat output).

Ok. Than answer is no on your question. But IPv4 should work anyway. At least it works for me.