rmic - The Java RMI Stub Compiler

rmic generates stubs and skeletons for remote objects.

SYNOPSIS

rmic [ options ] package-qualified-class-name(s)

DESCRIPTION

The rmic compiler generates stub and skeleton class files for remote objects from the names of compiled Java classes that contain remote object implementations (a remote object is one that implements the interface java.rmi.Remote). The classes named in the rmic command must be classes that have been compiled successfully with the javac command and must be fully package qualified. For example, running rmic on the class file name HelloImpl as shown here: rmic hello.HelloImpl

creates the HelloImpl_Skel.class and HelloImpl_Stub.class files.

A skeleton for a remote object is a server-side entity that contains a method which dispatches calls to the actual remote object implementation.

A stub is a proxy for a remote object which is responsible for forwarding method invocations on remote objects to the server where the actual remote object implementation resides. A client's reference to a remote object, therefore, is actually a reference to a local stub.

The stub implements only the remote interfaces, not any local interfaces that the remote object also implements. Because the stub implements exactly the same set of remote interfaces as the remote object itself, a client can use the Java language's built-in operators for casting and type checking.

OPTIONS

-classpath path
Specifies the path rmic uses to look up classes. This option overrides the default or the CLASSPATH environment variable if it is set. Directories are separated by semi-colons. Thus the general format for path is:
.;<your_path>
For example:
.;C:\usr\local\java\classes

-d directory
Specifies the root directory of the class hierarchy. You can use this option to specify a destination directory for the stub and skeleton files. For example, the command
% rmic -d C:\java\classes foo.MyClass
would place the stub and skeleton classes derived from MyClass into the directory C:\java\classes\foo. If the -d option is not used, the package hierarchy of the target class is ignored, and stub and skeleton files are placed in the current directory.

-depend
Makes the compiler consider recompiling classes which are referenced from other classes. Normally, it only recompiles missing or out-of-date classes that are referred to from source code.

-g
Enables generation of debugging tables. Debugging tables contain information about line numbers and local variables - information used by Java debugging tools. By default, only line numbers are generated, unless optimization (-O) is turned on.

-keepgenerated
Retains the generated .java source files for the stubs and skeletons and writes them to the same directory as the .class files, using the -d option if specified.

-nowarn
Turns off warnings. If used the compiler does not print out any warnings.

-O
Optimizes compiled code by inlining static, final and private methods. Note that your classes may get larger in size.

-show
Shows the GUI (graphical user interface) for the rmic compiler. Enter one or more package qualified class names (separated by spaces) and press either the Enter key or the Show button to create stubs and skeletons.

-verbose
Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded.

ENVIRONMENT VARIABLES

CLASSPATH
Used to provide the system a path to user-defined classes. Directories are separated by colons on UNIX and Macintosh and by semicolons on Win95. For example,
.;C:\usr\local\java\classes

SEE ALSO

javac, CLASSPATH