Microsoft KB Archive/235592

= SAMPLE: Use DefaultDU.exe to Install Java Classes into the Default Package =

Article ID: 235592

Article Last Modified on 6/14/2006

-

APPLIES TO


 * Microsoft Java Virtual Machine

-



This article was previously published under Q235592



SUMMARY
Installing default packages containing only Java classes into the Java Package Manager (JPM) requires special steps. You must first create a package named "default" and include this package in your CAB file. Any classes you put there will be placed into the "default" package in the JPM. DefaultDU.exe illustrates how to install the classes inside a default package into the JPM.



MORE INFORMATION
The following files are available for download from the Microsoft Download Center:

DefaultDU.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The DefaultDU sample contains the following files:
 * DefaultDU.java - A regular Java Applet that imports a package called pack1
 * Pack1 - Contains the following two java files: BtnChk.java and EdtChk.java
 * Default - Contains the DefaultDU.class only
 * DefaultDU.html - HTML page that loads the Applet and installs the CAB
 * DefaultDU.cab - The cabinet file
 * DefaultDU.bat - A batch file for creating cabinet files and code-signing

Use the following steps to use this sample:  Run the DefaultDU.bat file. A Test Certificate will appear when loading the applet for the first time. Select Yes. The applet with a button and an Edit Control appears. From File Explorer browse to %windir%/DownLoaded Program Files (windir = winnt or windows). You will see the Friendly Name, DefaultDU, under the Program File column. This shows that the DefaultDU.cab was successfully installed into the JPM. (Refer to DefaultDU.bat and DefaultDU.html to see how the Friendly Name is used.) Right-click DefaultDU and select Properties. Click the Dependency tab. Pack1 and the "default" package will install into the JPM under a NameSpace, which in this case is YourNameSpace.(Refer to DefaultDU.bat and DefaultDU.html to see how this NameSpace was used.) Click the Version tab, and you will see the Version number that was specified when creating the DefaultDU.cab  You will also find a DefaultDU.osd file that gets automatically generated when using DUBUILD to create the CAB. This is how it looks when you view it in a editor, such as Notepad. You need to first extract it using cabarc x defaultdu.cab: <?XML version="1.0"?> <!DOCTYPE SOFTPKG SYSTEM "http://www.microsoft.com/standards/osd/osd.dtd"> <?XML::namespace href="http://www.microsoft.com/standards/osd/msicd.dtd" as="MSICD"?>

<SOFTPKG NAME="DefaultDU" VERSION="1,1,1,1">

<TITLE>DefaultDU</TITLE>

<MSICD::JAVA>

<NAMESPACE>YourNameSpace</NAMESPACE>

<PACKAGE NAME="default" VERSION="1,1,1,1"> <IMPLEMENTATION/> </PACKAGE>

<PACKAGE NAME="pack1" VERSION="1,1,1,1"> <IMPLEMENTATION/> </PACKAGE>

</MSICD::JAVA>

</SOFTPKG>

</li> The packages (Pack1 and Default) that go under the NameSpace get installed as ZIP files under %windir%/Java/packages, where windir equals winnt or windows. However, it is hard to tell which ZIP file corresponds to these packages.</li> To find this out, run RegEdit and follow the steps below: <ol style="list-style-type: lower-alpha;"> Go to HKEY_LOCAL_MACHINE.</li> Select Software-Microsoft-Code Store Database.</li> Select Application NameSpaces-YourNameSpace.</li> Under Java Packages, click the packages. You will find the corresponding ZIP files that you can then browse to in the %windir%/java/packages.</li></ol> </li></ol>

<div class="references_section">