Compiling Microsoft and Netscape Security Classes

The Netscape and Microsoft-specific security classes must be compiled against ".class" files or a jar file to resolve references to various packages and classes. This is relatively easy to do in Netscape, somewhat harder for Microsoft. These steps assume you want to compile with the Sun JDK compiler; compilation with the Microsoft compiler is another issue.

Netscape

The Netscape-specific security class, NetscapeSecurityStrategy, needs access to varoius classes, such as netscape.security.PriviligeManager. This can be done by including the Netscape classes jar file during the compilation step. If Netscape is installed in the default location, compilation requires this:

javac -classpath "/vrtp;.;/Program Files/Netscape/Communicator/Program/java/classes/java40.jar" NetscapeSecurityStrategy.java

This picks up the all the directory structures under "vrtp" as a package, including the mil and org hierarchy; current directory; and the Netscape classes, including the security classes. The standard Sun classes and packages should be picked up by the compiler as well, even thought they are not specified in the classpath.

Microsoft

Microsoft is more difficult, as usual. The Microsoft system classes are usually kept in the /Windows/java/classes directory, under the filename classes.zip. If it is present, compiling the Microsoft-specific classes is as simple as just adding the zip file to the classpath; this is done automatically in the makefile. If it is not present, you need to download the SDK from Microsoft.The SDK includes tools that create a classes.zip file. (License restrictions prevent us from distributing a classes.zip file with the VRTP distribution.)

The makefile is smart enough to check for the existence of the classes.zip file, and will warn you if it is not present.

Generating the classes.zip file

You can download the Microsoft Java SDK 3.2 from http://www.microsoft.com/java/sdk/32/default.htm.
It is many megabytes. Download and install the SDK (Microsoft SDK for Java 3.2, debug classes not neccesary).

The installation directory includes a /Bin directory, which contains the utility program "clspack". Running this utility as below generates a classes.zip file and saves it in the /Windows/java/classes directory.

clspack -auto

Once the classes.zip file is generated, it can simply be added to the classpath. Again, the makefile automaticaly looks for the classes.zip file in the location mentioned when compiling Microsoft-specific code.
 

Sun JDK


Nothing special is needed to compile for the Sun JDK. The security is actually controlled by the policy file in the JDK distribution.