Installation of the NetRexx compiler


Here's how to install the NetRexx compiler and runtime classes:

  1. Copy the 'nrtools.zip' or 'nrtools.tar.Z' file from the NetRexx documentation directory to the Java home directory, using the original name. The name of the Java home directory will vary depending on the operating system you are using. Some possibilities are:
      /java 
      /jdk1.1/java
      \javaos2
      \jdk1.1\java
    

    It will contain directories such as 'bin' and 'lib'.

    [Note: if your Java home directory is on a CD-ROM, or otherwise inaccessible, you'll need to choose a different directory and set up a CLASSPATH environment variable that points to it. Consult your Java toolkit documentation for details on how to do this. You'll also need to set the NetRexx home directory -- see below.]

  2. With the Java home directory as your current directory, unpack the package, following the instructions in "Unpacking NetRexx packages" above.

    This should add the .zip files for the NetRexx runtime and compiler classes (NetRexxR.zip and NetRexxC.zip) and the compiler's error message file (NetRexxC.properties) to the Java 'lib' directory.

    In addition, some sample scripts and a test program should have been added to the Java 'bin' directory:

      hello.nrx    -- a simple NetRexx program for testing
      NetRexxC.cmd -- the NetRexx compiler command in Rexx
      NetRexxC.bat -- similar NetRexx compiler command (Windows .bat)
      nrc.cmd      -- shorter name for NetRexxC.cmd
      nrc.bat      -- shorter name for NetRexxC.bat
    

    The .cmd files are simple Rexx scripts for making it easier to use the compiler. 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: http://www2.hursley.ibm.com/rexx/

    Under Windows, the .bat files should work -- they are not as flexible as the .cmd files, but will save typing.

  3. Check that the names are correct in the 'lib' directory: there should be a file in the directory called 'NetRexxC.properties'; if the name is all in lowercase, or the word 'properties' is truncated, the package has not been unpacked correctly (see "Unpacking NetRexx packages").
  4. For Java to be able to find the NetRexx classes, you must update the CLASSPATH environment variable by adding the full path and name of the NetRexxC.zip file to the CLASSPATH setting. There will often already be a CLASSPATH variable set, including a path to the standard Java classes.zip file. Specify or add the full path (disk, directories, and file specification) for NetRexxC.zip, making sure that the case of every letter is exactly right (Java is very case-sensitive). For example, the full path might be something like:
      e:\java1.1\java\lib\NetRexxC.zip 
    

    The procedure for setting the CLASSPATH variable depends on your operating system (and there may be more than one way). Here are some examples:

    If you are unsure of how to do this, check the documentation you have for installing the Java toolkit.

Note: If you add NetRexxC.zip to the CLASSPATH value then you do not need to add NetRexxR.zip; the latter contains only the NetRexx runtime classes (which are provided separately for people who don't want to run the NetRexx compiler). These runtime classes are also included in NetRexxC.zip. Whichever zip is used, the NetRexx runtime classes can be referred to from Java or NetRexx as being in the 'netrexx.lang' package. For example, a string might be of class 'netrexx.lang.Rexx'.

Checking your installation is correct

To check installation, change directory to the Java 'bin' directory, then (being very careful to get the case of letters correct):

With the sample scripts provided (NetRexxC.cmd or NetRexxC.bat), or the equivalent in the scripting language of your choice, the steps above can be combined into a simple single command:

  NetRexxC -run hello

This package also includes a trivial 'nrc.cmd' and matching 'nrc.bat' file that simply passes on its arguments to NetRexxC; 'nrc' is just a shorter name that saves keystrokes, so for the last example you could type:

  nrc -run hello

Note that scripts may be case-sensitive; unless running the OS/2 Rexx script, you will probably have to spell the name of the program exactly as it appears in the filename.

You could also edit the nrc.cmd or nrc.bat and add your favourite 'default' NetRexxC options there (if you do this, keep a backup copy, so that if you install a new version of the NetRexx package you won't overwrite your changes).

The NetRexx Home directory

If you need to put the NetRexxC.properties (messages) file into a directory other than the 'lib' directory below the Java home directory, then you can set an alternative directory path that NetRexx will use to find the messages file.

This alternative directory is called the NetRexx home directory and may be set using the -D option on the java command that invokes the NetRexx compiler. For example (perhaps for an OS/2 or Windows system):

  java -Dnetrexx.home=f:\nrhome COM.ibm.netrexx.process.NetRexxC hello

which sets the directory path 'f:\nrhome' as the NetRexx home directory. With this setting, NetRexxC would look for the messages file as:

  f:\nrhome\lib\NetRexxC.properties 

In other words, NetRexxC expects its properties file to be in the 'lib' directory below the NetRexx home directory, and the default NetRexx home directory is the Java home directory.

If you are using the NetRexxC.cmd on OS/2 to invoke the compiler, then this -D option will be set up automatically if the path is set as the value of an environment variable called NETREXX_HOME.


[ previous section | contents | next section ]

From 'nrinst.doc', version 1.00.
Copyright(c) IBM Corporation, 1996, 1997. All rights reserved. ©