ClassFileServer is an implementation of a mini-webserver that can be used by an RMI application to load classes over the network. Typically, RMI uses an HTTP server to load files from a URL. The ClassFileServer provides the same basic functionality as an HTTP server does.
First compile the java files, ClassServer.java and ClassFileServer.java, and then run ClassFileServer. You have to specify the port to which you want the server to listen and the classpath where the server locates class files.
Type
on (Solaris)
% java ClassFileServer 2001 $HOME/java/codebase
or on (Windows)
C:> start java ClassFileServer 2001 /home/java/codebase
When you start up your RMI server, the codebase URL you supply simply needs to be the URL containing the host and port that the ClassFileServer runs on.
Type
on (Solaris)
% java -Djava.rmi.server.codebase=http://orion:2001/ MyRMIServer
or on (Windows)
C:> start java -Djava.rmi.server.codebase=http://orion:2001/ MyRMIServer