Example: Enable Java 2 security prior to J2EE application client runtime initialization

To enable Java 2 security prior to J2EE application client runtime initialization, set the com.ibm.websphere.client.applicationclient.archivedir system property. Perform the following steps:

  1. Set the system property to the directory that the Enterprise Archive (EAR) should be expanded. For example:

    -Dcom.ibm.websphere.client.applicationclient.archivedir=/home/homedir
    (iSeries) 
    
    -Dcom.ibm.websphere.client.applicationclient.archivedir=c:\myear1
    (Windows)
    
    -Dcom.ibm.websphere.client.applicationclient.archivedir=/usr/mrear1
    (Unix)
    
  2. Set the java.security.policy system property to use the was_home/properties/client.policy file, where was_home is the installation path of your WAS. For example:

    -Djava.security.policy=$was_home/properties/client.policy
    (iSeries or Unix)
    
    -Djava.security.policy=%was_home%\properties\client.policy
    (Windows)
    

The following effects are incurred when the com.ibm.websphere.client.applicationclient.archivedir system property is set:

There are two types of EAR files. The first type of EAR file is a single file that contains all enterprise application files. The second type of EAR file is a set of directories and subdirectories.

The following applies only if you are using the single file EAR file form:

When you specify the com.ibm.websphere.client.applicationclient.archivedir system property value, make sure that the directory you specify is unique for each EAR file that is used. For example, do not specify MyEar1.ear and MyEar2.ear to extract to the same directory.

You must create all directories up to, but not including, the last directory. For example, if the following was set:

com.ibm.websphere.client.applicationclient.archivedir=/usr/myears
/myear1

then the usr and myears directories must exist, but the myear1 directory does not have to exist prior to running the launchClient class.