Here's how to install the NetRexx compiler and runtime classes. These instructions apply to the majority of Java platforms (for use with Visual J++, please see below).
/java \java11 \jdk1.1.6
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.]
This should add the .zip files for the NetRexx runtime and compiler classes (NetRexxR.zip and NetRexxC.zip) 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 serve the same purpose -- they are not as flexible as the Rexx .cmd files, but will save typing.
e:\java11\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.
Under Windows NT 4.0 the CLASSPATH can be set using Start, Settings, Control Panel, System, Environment tab, System Variables, and clicking on CLASSPATH.
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.
set classpath=%CLASSPATH%;c:\java12\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.
set classpath=.;%CLASSPATH%
as this is no longer added automatically by the Java Virtual Machine.
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).
JDK 1.1.5 (and later toolkits) sometimes has a Just-In-Time compiler (JIT) that slows down rather than speeds up both the NetRexx and Java compilers: programs can take between two and three times as long to compile as compared to using JDK 1.1.4. You can measure compilation times by using (for example):
nrc hello -time
You can turn off the JIT to measure its effect. If you are using the nrc or NetRexxC .cmd or .bat file then set the environment variable:
SET NETREXX_JAVA=-nojit
Or specify the -nojit flag directly on the java command used to run the NetRexx compiler. Otherwise, and on some platforms, this can also usually be achieved by:
SET JAVA_COMPILER=XXX
(You may then get a message that the 'XXX' compiler could not be found. Ignore this message.)
(Many thanks to Mark Cathcart and John Kearney for the details in this section.)
The simplest way to do this is to first install the package on a workstation, following the instructions above, then copy or FTP the files you need to the EBCDIC machine. Specifically:
In general, binary files (.class files, and .zip files containing .class files) should always be transferred as BINARY -- the same binaries run on all platforms.
For specific hints and tips for installing on OS/390, see Mark Cathcart's web site at
http://www.s390.ibm.com/corner
which includes a presentation that describes OS/390 Java and NetRexx installation. Setting the classpath might look like this:
export CLASSPATH=$CLASSPATH:/u/j390/j1.1.1/lib/NetRexxC.zip
(Many thanks to Bill Potvin and Bernhard Hurzeler for the details in this and the following section.)
NetRexxC.zip
For example, if [java_root] is "E:\Java":
C:\>copy NetRexxC.zip E:\Java\Lib
C:\>set CLASSPATH=%CLASSPATH%;[java_root]\Lib\NetRexxC.zip;
For example, if [java_root] is "E:\Java", your CLASSPATH might then look like this:
CLASSPATH=E:\Java\Lib;E:\Java\TrustLib;E:\Java\Lib\NetRexxC.zip;
Under Windows NT 4.0 this can be done using Start, Settings, Control Panel, System, Environment tab, System Variables, and clicking on CLASSPATH.
Note that some versions of the jview package do not provide a "classes.zip" file by default, but the NetRexx compiler needs this to determine information about classes that you use. If this is the case, you will get a 'class not found' error for "java.lang.Object". In this case, run the command
clspack -auto
from a MS-DOS prompt to create the classes.zip file.
When running the NetRexx compiler, you must specify the "-nocompile" option to NetRexx in order to prevent it from trying to invoke the Java toolkit compiler (which isn't in the MicroSoft J++ classes).
For example, if hello.nrx is in the current directory:
jview COM.ibm.netrexx.process.NetRexxC hello -nocompile
The result of this step should be a Java source file called "hello.java".
jvc hello.java
The result of this step should be a Java .class file called "hello.class".
jview hello
Note that all the commands above probably have to be typed exactly as shown (Java is very case-sensitive). The supplied NetRexxC.bat can be modified to work with the above commands by using 'jview' instead of the 'java' command and adding the 'jvc' step.
[ previous section | contents | next section ]
From 'nrinst.doc', version 1.148.
Copyright(c) IBM Corporation, 1996, 1998. All rights reserved. ©