Here's how to install the NetRexx compiler and runtime classes:
/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.]
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.
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:
set classpath=.;f:\javaos2\lib\NetRexxC.zip
In this example, the first segment of the value (before the semicolon) lets classes in the current directory be found, and the second segment includes the classes needed by NetRexx. Both environments normally include the standard Java classes automatically.
CLASSPATH=<newdir>:$CLASSPATH export CLASSPATH
and changes for re-boot or opening of a new window should be placed in your .login (Bourne) or .profile (Korn) file
setenv CLASSPATH <newdir>:$CLASSPATH
and changes for re-boot or opening of a new window should be placed in your .cshrc file
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'.
To check installation, change directory to the Java 'bin' directory, then (being very careful to get the case of letters correct):
java COM.ibm.netrexx.process.NetRexxC hello
This should run the NetRexx compiler, which converts the NetRexx program 'hello.nrx' to the Java program 'hello.java'. It then invokes the default Java compiler (javac), to compile the file 'hello.java' to make 'hello.class'. The intermediate .java file is then deleted, unless an error occurred.
java hello
This runs (interprets bytecodes from) the 'hello.class' file, which should display a simple greeting. On some systems, you may first have to add the directory that contains the 'hello.class' file to the CLASSPATH setting (see above) so Java can find it.
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).
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. ©