Run the client program

If you have not refreshed or restarted the server since creating the JavaArithmetic component, refresh the server before running the client program.

Create a batch file or UNIX shell script to run the client application, then run it. The batch file or shell script configures the CLASSPATH environment variable, then runs the application using the JDK 1.3 java program included with your EAServer installation.

If necessary, you can run the client on a different machine than the server host, as long as your server uses a real host address and not localhost or 127.0.0.1.

StepsCreating the Windows batch file

  1. Create a file named runja.bat containing the commands below:

    call %JAGUAR%\bin\setenv.bat
    set CLASSPATH=%JAGUAR%\java\lib\easj2ee.jar;
    set CLASSPATH=%CLASSPATH%;%JAGUAR%\java\lib\easclient.jar
    set CLASSPATH=%CLASSPATH%;%JAGUAR%\html\classes
    set JAVA_HOME=%JAGUAR_JDK13%
    %JAVA_HOME%\jre\bin\java TutorialApps.JAConsole %* 
    
    

StepsCreating the UNIX shell script

  1. Create a file named runja containing the commands below:

    #!/bin/sh 
    . $JAGUAR/bin/setenv.sh
    CLASSPATH=$JAGUAR/java/lib/easj2ee.jar 
    CLASSPATH=$CLASSPATH:$JAGUAR/java/lib/easclient.jar
    CLASSPATH=$CLASSPATH:$JAGUAR/html/classes export CLASSPATH
    JAVA_HOME=$JAGUAR_JDK13
    $JAVA_HOME/jre/bin/java TutorialApps.JAConsole $*
    
    
  2. Change the file permissions to allow the script to be executed. For example:

    chmod 777 runja
    

StepsRunning the client application

  1. Run the batch or script file, specifying the server host name and IIOP port number on the command line as follows:

    runja iiop://host:iiop-port
    

    For example:

    runja iiop://myhost:9000
    

    If everything is working, the application prints the results from the invocation of the multiply method. If not, check the error text printed on the console where you ran the client, and check for error messages in the server log file.