rmic: The Java RMI Compiler — JDK 1.1 and later


    rmic [ options ] fully-qualified-classnames


The rmic compiler generates the stub and skeleton classes for remote objects that you’ve written. The rmic compiler is capable of generating stubs and skeletons for both the Java Remote Method Protocol (JRMP) or the CORBA Internet Interoperable Object Protocol (IIOP). Once you’ve compiled your remote objects using a standard Java compiler, such as javac, you need to run rmic, specifying the class names of your RMI implementation classes using their full packages.

For example, suppose you define an interface named utils.remote.TimeServer that extends java.rmi.Remote and write an implementation of this interface called utils.remote.TimeServerImpl. After compiling both with a Java compiler, you can run rmic, specifying utils.remote.TimeServerImpl as the class name argument.

The native RMI remote method protocol, JRMP, was updated in Java 2 Version 1.2. The rmic compiler in JDK 1.2 and later supports the generation of stubs that are compatible with JRMP Version 1.1, 1.2, or both. A key difference between the two is that 1.1 required the generation of both stub and skeleton classes for a remote interface, while 1.2 requires only the stub class (the server-side skeleton operations are implemented dynamically by the RMI runtime). The -vcompat, -v1.1, and -v1.2 options, described in the next section, control what flavor of stubs and skeletons are generated when you run rmic

Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.