NetRexx User's Guide, version 2.05 Copyright (c) IBM Corporation, 2005. All rights reserved. © | Draft of 14 Jan 2005
[previous | contents | next]

## Installation Problems?

If the ‘hello’ example described in the Testing the NetRexx Installation section doesn’t work, one of the following problems may be the cause:

- A Can’t find class COM.ibm.netrexx.process.NetRexxC... message probably means that the NetRexxC.jar file has not been specified in your CLASSPATH setting, or is misspelled, or is in the wrong case, or (for Java 1.2 or later) is not in the Java `\lib\ext` directory. Note that in the latter case there are two `lib` directories in the Java tree; the correct one is in the Java Runtime Environment directory (`jre`).
  The Setting the CLASSPATH section contains information on setting the CLASSPATH.
- A Can’t find class hello... message may mean that the directory with the hello.class file is not in your CLASSPATH (you may need to add a ‘`.;`’ to the CLASSPATH, signifying the current directory), or either the filename or name of the class (in the source) is spelled wrong (the java command is [very] case-sensitive). Note that the name of the class must not include the `.class` extension.
- The compiler appears to work, but towards the end fails with Exception ... NoClassDefFoundError: sun/tools/javac/Main. This indicates that you are running Java 1.2 or later but did not add the Java tools to your CLASSPATH (hence Java could not find the javac compiler). See the Installing for Java 1.2+ section for more details, and an alternative action.
  Alternatively, you may be trying to use NetRexx under Visual J++, which needs a different procedure. You can check whether `javac` is available and working by issuing the `javac` command at a command prompt; it should respond with usage instructions.
- You have an extra blank or two in the CLASSPATH. Blanks should only occur in the middle of directory names (and even then, you probably need some double quotes around the SET command or the CLASSPATH segment with the blank). The JVM is sensitive about this.
- You are trying the `NetRexxC.sh` or `nrc` scripts under Linux or other Unix system, and are getting a Permission denied message. This probably means that you have not marked the scripts as being executable. To do this, use the `chmod` command, for example: `chmod 751 NetRexxC.sh`.
- You are trying the `NetRexxC.sh` or `nrc` scripts under Linux or other Unix system, and are getting a No such file or syntax error message from bash. This probably means that you did not use the `unzip -a` command to unpack the NetRexx package, so CRLF sequences in the scripts were not converted to LF.
- You didn’t install on a file system that supports long file names (for example, on OS/2 or Windows you should use an HPFS or FAT32 disk or equivalent). Like most Java applications, NetRexx uses long file names.
- You have a down-level unzip utility, or changed the name of the `NetRexxC.jar` file so that it does not match the spelling in the classpath. For example, check that the name of the file ‘`NetRexxC.jar`’ is exactly that, with just three capital letters.
- You have only the Java runtime installed, and not the toolkit. If the toolkit is installed, you should have a program called `javac` on your computer. You can check whether `javac` is available and working by issuing the `javac` command at a command prompt; it should respond with usage information.
- An Out of environment space message when trying to set CLASSPATH under Win9x-DOS can be remedied by adding `/e:4000` to the ‘Cmd line’ entry for the MS-DOS prompt properties (try `command /?` for more information).
- An exception, apparently in the `RexxUtil.translate` method, when compiling with Microsoft Java SDK 3.1 (and possibly later SDKs) is caused by a bug in the Just In Time compiler (JIT) in that SDK. Turn off the JIT using Start -> Settings -> Control Panel -> Internet to get to the Internet Properties dialog, then select Advanced, scroll to the Java VM section, and uncheck ‘Java JIT compiler enabled’. Alternatively, turn of the JIT by setting the environment variable:

        SET MSJAVA_ENABLE_JIT=0

  (this can be placed in a batch file which invokes NetRexxC, if desired).
- A java.lang.OutOfMemoryError when running the compiler probably means that the maximum heap size is not sufficient. The initial size depends on your Java virtual machine; you can change it to (say) 24 MegaBytes by setting the environment variable:

        SET NETREXX_JAVA=-mx24M

  In Java 1.2.2 or later, use:

        SET NETREXX_JAVA=-Xmx24M

  The `NetRexxC.cmd` and `.bat` files add the value of this environment variable to the options passed to `java.exe`. If you’re not using these, modify your `java` command or script appropriately.
- You have a down-level version of Java installed. NetRexxC will run only on Java version 1.1.2 (and later versions). You can check the version of Java you have installed using the command ‘`java -version`’.
- Included in the documentation collection are a number of examples and samples (Hello, HelloApplet, etc.). To run any of these, you must have Java installed.
  Further, some of the samples must be viewed using the Java toolkit applet-viewer or a Java-enabled browser. Please see the hypertext pages describing these for detailed instructions. In general, if you see a message from Java saying:

        void main(String argv[]) is not defined

  this means that the class cannot be run using just the ‘java’ command; it must be run from another Java program, probably as an applet.

Do you have any NetRexx problem-solving tips not covered above? If so, please let me know, at `mailto:mfc@uk.ibm.com`

[previous | contents | next]