How to Specify Network Address.* Security Properties when Pushing Java Applications
search cancel

How to Specify Network Address.* Security Properties when Pushing Java Applications

book

Article ID: 297715

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

This document describes how to specify Java Security Properties when pushing Java applications.

 


Environment


Cause

If you are developing for non-PCF Java applications, setting security properties can be done by following either one of these methods:

1. Editing $JAVA_HOME/jre/lib/security/java.security and adding the following lines:

  • networkaddress.cache.ttl=60
  • networkaddress.cache.negative.ttl=20

2. Or, using applications initialization code, sample below:

  • java.security.Security.setProperty("networkaddress.cache.ttl" , "60");

 

Resolution

Here are the steps on how to add Java Security Properties when pushing Java applications:

1. Edit your application manifest file

2. Locate env and add the security properties in your JAVA_OPTS. Please note that you need to append java.security prefix
 

env:

JAVA_OPTS: -Djava.security.networkaddress.cache.ttl=60 -Djava.security.networkaddress.cache.negative.ttl=20



Additional Information

Java Networking Properties

How to set java environment variables in PCF and PWS.