Appendix A. Java IPv4/IPv6 Properties

Configuring Java properties

In Java there are 2 properties that are used to configure IPv4 and IPv6. These are and (default: false)

If IPv6 is available then the underlying native socket, by default, is an IPv6 socket. This socket lets applications connect and accept connections from IPv4 and IPv6 hosts. If application use only IPv4 sockets, then set this property to true. However, it will not be possible for the application to communicate with IPv6 only hosts. (default: false)

If a host has both IPv4 and IPv6 addresses, and IPv6 is available, then the default behavior is to use IPv4 addresses over IPv6. This allows backward compatibility. If applications that depend on an IPv4 address representation, for example: Then, set this property to true to change the preference and use IPv6 addresses over IPv4 where possible.

To pass these properties to Tomcat, set CATALINA_OPTS in the JWS_HOME/tomcat/bin/setenv.* file.


If the JWS_HOME/tomcat/bin/ or JWS_HOME/tomcat/bin/setenv.bat file does not exist, then you need to create one.

On Linux:

export ""

On Windows:

set ""

Configuring Tomcat bindings

The Tomcat bindings can be set in JWS_HOME/tomcat/conf/server.xml with the IPv6 address:

  • Specify the Tomcat binding address:

    <Server …​ address="TOMCAT_BINDING_ADDRESS">

  • Specify the HTTP connector address:

    <Connector protocol="HTTP/1.1" …​ address="HTTP_CONNECTOR_ADDRESS">

  • Specify the AJP connector address:

    <Connector protocol="AJP/1.3" …​ address="AJP_CONNECTOR_ADDRESS">