JavaReg Main Topic | Next
JavaReg Syntax
javareg [{/register | /unregister} /class:JavaClass [/clsid:CLSID] [options]] [/?]
Where:
- /register
- registers the Java class specified by /class:JavaClass as a COM component in the registry with the optional class identifier specified in /clsid. If you use /register, you must specify at least /class as well, and you can also specify /clsid. Omitting /clsid forces JavaReg to create and register a CLSID.
JavaReg also recognizes /regserver for this command.
Example One
You can use /codebase, /control, and /typelib with /register to register a JavaBean object as a Microsoft® ActiveX® Control. If you use /control to register a JavaBean, you must also generate a type library using /typelib.
Example 4
- /unregister
- unregisters the Java class specified by /class:JavaClass. If you specify /unregister, you must also specify /class:JavaClass.
JavaReg also recognizes /unregserver for this command.
- /class:JavaClass
- specifies the class to be registered or unregistered with the class identifier provided in /clsid. If this option is specified, either /register or /unregister must also be specified. If no class identifier is provided, JavaReg generates a CLSID.
If you run JavaReg again with the same Java class name, the tool reuses the CLSID already assigned to the Java class. So to reconfigure the class, you can execute JavaReg with additional options later (for example, by specifying the /surrogate option).
- /clsid:CLSID
- specifies the class identifier CLSID to be registered with the class. Omitting this parameter forces JavaReg to create and register a CLSID.
Example Two
- options
- specifies one or more of the following options.
- /codebase:[{Path | URL}]
- specifies the base location, either a path to a directory name or a URL, that contains the Java class. This option can be used with /register as a part of registering a JavaBeans object as an ActiveX Control.
Example Four
- /control
- adds the necessary registry information for containers to treat the Java class as an ActiveX Control. This option can be used with /register as a part of registering a JavaBeans object as an ActiveX Control. If you use this option, you must also use /typelib.
Example Four
- /nomktyplib
- registers an existing typelib, specified in the file name argument of the /typelib option, without creating a new typelib.
- /progid:ProgID
- specifies a ProgID for the class being registered. By default, JavaReg does not assign a COM ProgID to your class. This option lets you designate what ProgID to use.
Example Three
- /q
- suppresses all message boxes (quiet mode). Regardless of whether this option is specified, JavaReg returns 0 (zero) on success and 1 (one) on failure.
- /remote:RemoteServerName
- activates the class on a remote server using Distributed Component Object Model (DCOM).
To activate and call a Java class on a different computer using DCOM, use /remote on the client computer. When using this option, the Java class cannot be activated on the client computer—only on the server. RemoteServerName can be any computer identifier supported by DCOM, typically, a NetBIOS name, a DNS name, or a decimal-dotted IP address.
Example Five
- /surrogate
- supports remote access to COM classes, writing the registry entries required to allow the Java class to be activated out-of-process (in a system-provided surrogate process). Use the /surrogate option when registering your Java class to run as a Distributed Component Object Model (DCOM) server. This is necessary if you want your Java class to be activated and called from a different computer.
If you do not specify the CLSID when using /surrogate, JavaReg generates one.
Example Five
- /typelib:FileName
- Generates a type library for a Java class at the location of the specified FileName. To register a typelib without generating a new one, use this option with /nomktyplib. This option can also be used with /register as a part of registering a JavaBeans object as an ActiveX Control.
Example Four
- /?
- displays command-line syntax in a dialog box.
Values Returned
JavaReg returns 0 (zero) on success and 1 (one) on failure.