How to get the value of networkaddress.cache.ttl

I have a java application running in an alpine container. I would like to find a reliable way to determine what is the value of networkaddress.cache.ttl. I tried to use this in the code of the application:"networkaddress.cache.ttl"); but it always returns null, even when I use -Dnetworkaddress.cache.ttl=30 in the JAVA_OPTS arguments. So I am doing something wrong obviously but I don't know what. According to this networkaddress.cache.ttl null in openjdk I don't even need to add the argument in JAVA_OPTS because the default value is 30 anyway. Looking at /usr/local/openjdk-8/jre/lib/security/ inside the container I can see #networkaddress.cache.ttl=-1 but it is commented out, so I have no idea what the default value is. So how can i reliably check what is the value of networkaddress.cache.ttl?

Read more here:

Content Attribution

This content was originally published by Corneliu at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: