rmic - The Java RMI Stub Compiler

rmic generates stubs and skeletons for remote objects.


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


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.


-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 colons. Thus the general format for path is:
For example:

-d directory
Specifies the root directory of the class hierarchy. If ommitted, the root defaults to the current directory.

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.

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.

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.

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

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

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.

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


Used to provide the system a path to user-defined classes. Directories are separated by colons. For example,


The javac command.