The following tutorial shows how to install a set of Java libraries into the Microsoft virtual machine using a distribution unit created with the dubuild utility. The tutorial uses JPMBrowser as the example package.
To create and distribute DUs
You should choose a meaningful and descriptive name for your package and use the com.company.packagename naming convention. The JPMBrowser example is a Microsoft library for Java so it uses the com.ms. prefix. The resulting package name is com.ms.JPMBrowser.
Make sure your directory structure reflects the package name. In the JPMBrowser example below, the working directory that contains the .class files is C:\projects\JPMBrowser\com\ms\JPMBrowser.
C:\>cd \projects\JPMBrowser
C:\..\JPMBrowser>dubuild jpm.cab . /D "JPM Browser" /I *.class /V 1,1,23,0
In this command, the /D option specifies a friendly name for the DU, the /I option specifies that only Java class files are included, and the /V option specifies the version number.
C:\projects\JPMBrowser>extract /D jpm.cab Microsoft (R) Diamond Extraction Tool - version (16) 1.00.0530 (04/3/95) Copyright (c) Microsoft Corp 1994-1995. All rights reserved. Cabinet jpm.cab 07-30-1997 5:50:32p ---- 295 JPM Browser.osd 07-20-1997 6:38:42p A--- 1,960 com\ms\JPMBrowser\JPMPanel.class 07-20-1997 6:38:42p A--- 678 com\ms\JPMBrowser\BrowserFrame.class 07-20-1997 6:38:42p A--- 1,289 com\ms\JPMBrowser\BrowserApplet.class 4 Files 4,222 bytes
The Open Software Distribution (OSD) file that is packaged with the DU is automatically generated by the dubuild utility. The OSD file contains a list of the included Java packages and sets the version number to be 1.1.23.0. Note that when specifying version numbers on the command line, the version number must be comma-separated.
Make sure that your packages are in the appropriate (in this case, com\ms\JPMBrowser) subdirectory, as shown above.
To test the installation of the DU, write an HTML page that installs and runs the application or applet. The HTML for the JPMBrowser sample applet uses an <APPLET> tag and several special useslibrary parameters. These parameters specify the friendly name, location, and version of the DU as shown in the example below. For more information on the <APPLET> tag and associated parameters, see HTML Tags to Install DUs.
<APPLET code=com.ms.JPMBrowser.BrowserApplet width=200 height=200> <PARAM NAME=useslibrary VALUE="JPM Browser"> <PARAM NAME=useslibrarycodebase VALUE="jpm.cab"> <PARAM NAME=useslibraryversion VALUE="1,1,23,0"> </APPLET>
You can place this applet in an HTML file that is in the same directory as your cabinet file, or you can specify a remote location for the cabinet file in the useslibrarycodebase parameter. To test the installation, browse the HTML page in Microsoft® Internet Explorer. It should install the cabinet file and show the applet on the page.