O'Reilly logo

Java Enterprise in a Nutshell, Third Edition by William Crawford, Jim Farley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

rmic: The Java RMI Compiler — JDK 1.1 and later

Synopsis

    rmic [ options ] fully-qualified-classnames

Description

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required