Troubleshooting

You can use the following methods to troubleshoot issues when building and running non-OO COBOL applications that interoperate with Java™.

About this task

  1. Make sure that cob2 and cjbuild are in your PATH environment variable. When building from JCL, ensure you set the ZFSCBDIR JCL variable to the location of your zFS COBOL install directory.
  2. Make sure that JAVA_HOME is set in your environment and points to an appropriate Java JDK. For example:
    export JAVA_HOME=/usr/lpp/java/IBM/J8.0_64
    or:
    export JAVA_HOME=/usr/lpp/java/IBM/J11.0_64
    When building and running from JCL, make sure the JAVAHOME JCL variable is set properly.
  3. Make sure the following environment variables are set at run time:
    For z/OS UNIX scripts:
    
    export IBM_JAVA_OPTIONS="-XX:+Enable3164Interoperability"
    export _CEE_RUNOPTS="POSIX(ON)"
    If running from JCL, make sure your CEEOPTS DD is handled similar to the following:
    
    //CEEOPTS DD *,SYMBOLS=EXECSYS
    POSIX(ON)
    ENVAR(
    "JAVA_HOME=&JAVAHOME",
    "IBM_JAVA_OPTIONS=-XX:+Enable3164Interoperability",
    "PATH=.:/bin:/usr/bin:/usr/local/bin",
    "CLASSPATH=&CLASSOUT",
    "LIBPATH=&JAVAHOME/lib:&JAVAHOME/lib/j9vm")
  4. If you have an application that starts on the COBOL side and calls Java and Java displays to the terminal, but you do not see the output when running from JCL, try adding the following line at the top of your Java program:
    ZUtil.redirectStandardStreams();
  5. If you encounter linking errors during execution of the cjbuild utility, try adding the following export to your environment:
    export _C89_LSYSLIB=CEE.SCEELKED
    Note: If you have your runtime datasets installed under a different HLQ, then use the corresponding SCEELKED for those datasets instead.
    Link error messages:
    
    # Linking native method DLL
    /home/userid/cobol/igyv6r4/bin/cob2 -bdll -o //COBOL.LOAD(libapp1) COBPROD_java_native_app1.o COBPROD_java_native_WS_app1.o addlist_java_native_app1.o Java.CobProd.printResult.o /home/userid/jtoc/demo2/java_new5/J8.0_64/bin/j9vm/libjvm.x /home/userid/cobol/igyv6r4/lib/igzcjni2.x
    # Command return code 3:
     IEW2456E 9207 SYMBOL IGZXLERR UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM
              THE DESIGNATED CALL LIBRARY.
     IEW2456E 9207 SYMBOL IGZXDER UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE
              DESIGNATED CALL LIBRARY.
     IEW2456E 9207 SYMBOL IGZXDED UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE
              DESIGNATED CALL LIBRARY.
     IEW2638S 5384 AN EXECUTABLE VERSION OF MODULE *NULL* EXISTS AND CANNOT BE
              REPLACED BY THE NON-EXECUTABLE MODULE JUST CREATED.
    FSUM3065 The LINKEDIT step ended with return code 12.