NetRexx User's Guide, version 2.02
Copyright (c) IBM Corporation, 2001. All rights reserved. ©
Draft of 22 May 2001
[previous | contents | next]

Installing for Java 1.2+

This section gives a detailed procedure for installing NetRexx using a Java 1.2, or later, development kit. The steps are as follows:
  1. Locate the Java home directory. The name of the Java home directory will vary depending on the operating system you are using. Some possibilities are:
    It will contain directories such as ‘bin’ and ‘lib’.

    Note: if your Java home directory is on a CD-ROM, or on an unwritable shared disk, you'll need to leave the NetRexx files elsewhere and set up CLASSPATH and PATH environment settings to refer to them. Consult your Java toolkit and operating system documentation for details on how to do this.

  2. Copy or move the NetRexxC.jar file to the Java lib\ext directory. For Java to be able to find the NetRexx classes, it's simplest to just put them (that is, the NetRexxC.jar file which contains them) in the Java extension directory. This is the \lib\ext directory below the Java home directory, which should already exist (if it does not, then you probably have the wrong lib directory – its parent should be called jre). The JVM will then automatically find it there when it is needed.
    Alternatively, you could add the NetRexxC.jar file to the CLASSPATH, as described in the Installing for Java 1.1 section.
    Note: if you have a in your CLASSPATH from an earlier version of Rexx, remove it (NetRexxC.jar replaces
  3. Copy the executables. Copy all the files in the NetRexx\bin directory to a directory which is in your search PATH (perhaps the \bin directory below the Java home directory). This will allow them to be invoked simply by typing their name at a command prompt.
    The files in the bin directory should be:
      hello.nrx    -- a simple NetRexx program for testing
      NetRexxC.cmd -- the NetRexx compiler command in Rexx
      NetRexxC.bat -- similar NetRexx compiler batch script (Windows .bat)
   -- similar NetRexx compiler shell script for Linux and Unix
      nrc.cmd      -- shorter name for NetRexxC.cmd
      nrc.bat      -- shorter name for NetRexxC.bat
      nrc          -- shorter name for
    The .cmd files are simple Rexx scripts for making it easier to use the translator. You don't have to use these, but they save some typing. They should require little modification to run under the Rexx interpreter for your platform; for details of Rexx interpreters, see: Under Windows, the .bat files should serve the same purpose – they are not as flexible as the Rexx .cmd files, but will save typing.
    Similarly, under Linux or other Unix systems, the and nrc script simplify use of the translator. You may need to indicate these are executable, using (for example) the commands: chmod 751 and chmod 751 nrc and (unless you used the unzip -a command to unpack them) you may need to run dos2unix on both of them (this converts CRLF to LF).
    Alternatively, the NetRexx\bin directory could be added to the PATH environment setting.
  4. Add the Java tools.jar file to the CLASSPATH. If you would like NetRexx to use the javac compiler for compilations (which is the default) then you will need to add the Sun tools collection to the classpath. This is usually found in a file called tools.jar in the Java lib directory. For example:
      set classpath=%CLASSPATH%;c:\java1.2\lib\tools.jar
    (with the path changed as appropriate) would add the tools.jar to the existing classpath in an OS/2 or Windows system. The procedure for setting the CLASSPATH variable depends on your operating system (and there may be more than one way), as described in the Setting the CLASSPATH section.
    Alternatively, the tools.jar file could be moved to the Java lib\ext directory.
  5. Add the current directory to the CLASSPATH. If it is not already there, add a reference to the current directory to the CLASSPATH, for example:
      set classpath=.;%CLASSPATH%
    This is needed if you cannot compile and run test programs from within a directory other than in the Java tree.

NetRexx installation is now complete. Now would be a good time to check that it works, as described in the Testing the NetRexx Installation section.

[previous | contents | next]