Running the Java byte code

Perform these steps to run a compiled Java™ program.

Procedure

  1. Change to the directory that contains the compiled Java program you want to run.
  2. Issue this command to run a program <program>.class:
    java -classpath <fullpath>/CNM.jar:. <program>.class
    where <fullpath> is the location of CNM.jar. The period (.) at the end of the class path ensures that Java can find <program>.class in the current directory.
    The following example uses the default path and the compiled sample program of Sample program in Java:
    javac -classpath /opt/IBM/CCA/cnm/CNM.jar:. RNGpk.class
    If the program uses the Master Key Process (CSNBMKP) verb in addition to other verbs, you must also include CNMMK.jar in the class path (see Using the Master Key Process (CSNBMKP) verb). Issue this command to run such programs:
    java -classpath <fullpath>/CNM.jar:<fullpath>/CNMMK.jar:. <program>.class
    Tip: Instead of using the -classpath option, you can set the CLASSPATH variable to point to CNM.jar and, if required, CNMMK.jar.