Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 

Bootstrap Example


by jGuru

[Exercise | API Docs | Short Course| Exercises]

Help is available for each task.



    Task 1

    Save the two program files and the runhttp.bat command file into some directory and compile the HTTP Server files


    Use the javac program to compile all the Java files:

    javac ClassServer.java
    javac ClassFileServer.java
    

    Task 2

    Start the HTTP Server


    Start a new console window and go to the directory where the compiled classes are located. When you run the HTTP Server, you will pass it two parameters. The first is the port on which the server listens. The second is the directory path to the RMI class files to be delivered across the network.

    Use the following command to start the HTTP Server:

    java ClassFileServer 2002 <path to class file directory>
    

    The included batch file, runhttp.bat, requires updating to set the appropriate path before running.

    Task 3

    Compile all of the class files for the client and server


    In a separate console window, save the client and server files to a separate subdirectory, and compile all of the .java source files:

    javac MessageObject.java
    javac Hello.java
    javac RMIServer.java
    javac HelloImpl.java
    javac RMIClient.java
    

    This will compile the server and all of the client classes that will be bootstrap loaded across the network.

    Task 4

    Create the stub and skeleton files for the remote object implementation


    Use the rmic utility on the implementation class, HelloImpl.

    rmic HelloImpl

    Task 5

    Run the RMI server program


    To help you run the RMI Server, a command (batch) file, runserver.bat, has been created. Edit that file and put in the correct information for your computer and then run the server in its own console window.

    Task 6

    Compile the class files for the client bootstrap loader program


    In a separate console window, save the client bootstrap loader program files and the runclient.bat command file in a separate subdirectory, and compile the .java source files:

    javac RMIClientBootstrapSecurityManager.java
    javac RMIServer.java
    

    The sole purpose of the bootstrap loader program is to start and then request the 'real' client software from the network.

    Task 7

    Edit the runclient.bat command file to include the name of your computer


    Change the name "ROSA" to the name of your computer. The command file will now be ready to run.

    Task 8

    Run the runclient.bat command file.


Copyright 1996-2000 jGuru.com. All Rights Reserved.


[ This page was updated: 11-Feb-2000 ]
Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-2000 Sun Microsystems, Inc.
All Rights Reserved. Terms of Use. Privacy Policy.