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

ID: Q235592


The information in this article applies to:
  • Microsoft virtual machine


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. Click the file names below to download the files:

DefaultDU.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center. 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:
  1. 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.


  2. From File Explorer browse to %windir%/DownLoaded Program Files (windir = winnt or windows).


  3. 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.)


  4. Right-click DefaultDU and select Properties.


  5. 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.)


  6. Click the Version tab, and you will see the Version number that was specified when creating the DefaultDU.cab


  7. 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">
    <!-- created by DUBuild version 5.00.3167 -->
    
    <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>
     


  8. 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.


  9. To find this out, run RegEdit and follow the steps below:
    1. Go to HKEY_LOCAL_MACHINE.


    2. Select Software-Microsoft-Code Store Database.


    3. Select Application NameSpaces-YourNameSpace.


    4. Under Java Packages, click the packages. You will find the corresponding ZIP files that you can then browse to in the %windir%/java/packages.





REFERENCES

For more information on DUBUILD, please refer to the SDK32 For Java documentation available at the following Web site:

http://www.microsoft.com/java
For more information on how to make your java code trusted under Internet Explorer, please refer to the following article in the Microsoft Knowledge Base:
Q193877 HOWTO: Make Your Java Code Trusted in Internet Explorer

For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, please see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/

http://support.microsoft.com/support/java/

Additional query words:

Keywords : kbfile kbJava kbJavaVM kbSDKJava kbSecurity kbVJ600 kbGrpJava kbDSupport kbJavaVMFAQ
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: December 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.