添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
検索

このコンテンツは選択した言語では利用できません。

Appendix A. Java IPv4/IPv6 Properties

download PDF

Configuring Java Properties

In Java there are 2 properties that are used to configure IPv4 and IPv6. These are java.net.preferIPv4Stack and java.net.preferIPv6Addresses . java.net.preferIPv4Stack (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. java.net.preferIPv6Addresses (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: 192.168.1.1. 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/setenv.sh or JWS_HOME /tomcat/bin/setenv.bat file does not exist, then you need to create one. On Linux: export "CATALINA_OPTS=-Djava.net.preferIPv4Stack= YOUR_VALUE -Djava.net.preferIPv6Addresses= YOUR_VALUE " On Windows: set "CATALINA_OPTS=-Djava.net.preferIPv4Stack= YOUR_VALUE -Djava.net.preferIPv6Addresses= YOUR_VALUE "

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 ">