User's Guide - Installing for Visual J++

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 Visual J++

(Many thanks to Bill Potvin and Bernhard Hurzeler for the details in this section.)

Here's how to install NetRexx for use with Visual J++:

1. Copy the following file into the [java_root]`\Lib` directory:

         NetRexxC.jar

   For example, if [java_root] is at `E:\Java`:

         C:\>copy NetRexxC.jar E:\Java\Lib

2. Similarly, copy the `nrc.bat` and `NetRexxC.bat` files to the [java_root]`\Bin` directory.
3. Add the jar file explicitly to the CLASSPATH:

         C:\>set CLASSPATH=%CLASSPATH%;[java_root]\Lib\NetRexxC.jar;

   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.jar;

   Under Windows NT 4.0 and Windows 2000 this can be done using Start, Settings, Control Panel, System, Environment tab, System Variables, and clicking on CLASSPATH.

#### Using NetRexx with Visual J++

Using NetRexx with J++ is very similar to using it with other Java development kits; the main difference is in the command names:

1. Use the J++ `jview` command to invoke the NetRexx translator to convert a NetRexx program (e.g., `hello.nrx`) into a Java program (`hello.java`).
   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 an 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 `javac` (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`.
2. Use the J++ ‘jvc’ command to compile the Java source file:

         jvc hello.java

   The result of this step should be a Java class file called `hello.class`.
3. Execute the class file with the J++ command `jview`:

         jview hello

4. Note that some earlier versions of `jview` fail with an exception (an `ArrayIndexOutOfBoundsException` in RexxUtil.translate) when compiling `hello.nrx`. This is due to a bug in the jview JIT;[1] the workaround is to turn the JIT off.

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.

Footnotes:

[1] | Just In Time compiler.

[previous | contents | next]