JAVAIOP

The JAVAIOP option controls the behavior of COBOL programs that interoperate with Java™ though the JAVA-CALLABLE or JAVA-SHAREABLE directives or by calling Java static methods using the CALL statement.

JAVAIOP option syntax

Read syntax diagramSkip visual syntax diagramNOJAVAIOPJAVAIOP(,OUTPATH('zos-unix-directory')NOJVMINITOPTIONSJVMINITOPTIONS(jvm-init-string)NOJAVA64JAVA64)

Default is: NOJAVAIOP

Abbreviations are:
  • JIOP = JAVAIOP
  • NOJIOP = NOJAVAIOP
  • OP = OUTPATH
  • JVMI = JAVAINITOPTIONS
  • NOJVMI = NOJAVAINITOPTIONS
OUTPATH('zos-unix-directory')
The default is the current working directory for the userid under which the compiler is running. If the compiler is not invoked from z/OS UNIX, the current working directory is the home directory for the userid under which the compiler is running. 'zos-unix-directory' must be specified within quotes and must exist prior to running the compiler.
Note: You must specify 'zos-unix-directory' when using OUTPATH option, and JAVAIOP(OUTPATH) alone is not supported. Otherwise, you will receive a compiler diagnostic message.
The OUTPATH suboption is used to specify the z/OS UNIX directory where the artifact files will be generated by COBOL programs that contain one of the following:
  • The JAVA-CALLABLE directive
  • The JAVA_SHAREABLE directive
  • A CALL statement with a literal call target of the form 'Java.java-class-name.java-static-method-name'.
Artifact files that are generated include the following:
  • The COBOL native method stub for programs that contain the JAVA-CALLABLE directive
  • WORKING-STORAGE initialization stubs that are generated for programs that use the JAVA-SHAREABLE directive
  • Java call stub files generated by the compiler when the COBOL application contains CALL statements with a literal call target of the form 'Java.java-class-name.java-static-method-name'
The maximum supported length of zos-unix-directory is 1023 characters.
NOJAVAINITOPTIONS|JAVAINITOPTIONS(jvm-init-string)
jvm-init-string specifies the initialization string that is to be used to initialize the Java virtual machine (JVM). This is only relevant in scenarios where the application starts on the COBOL side and then makes a call to Java, which requires the COBOL side of the application to start the JVM.
The default is -Djava.library.path=., which indicates that the DLL that contains COBOL native method stubs and working-storage initialization stubs are located in the current directory where the Java application is running.
The maximum length of jvm-init-string is 256 characters.
NOJAVA64|JAVA64
The default is NOJAVA64. Specifying the JAVA64 suboption when LP(32) is in effect indicates that the COBOL program will interoperate with 64-bit Java. As a result, Java object references will be treated as 8 bytes instead of 4 bytes.
Note: The JAVAIOP compiler option can only be specified for the first program in a sequence of programs (batch compilation). If you specify JAVAIOP in a CBL or PROCESS statement for a program other than the first program in the sequence, you will receive a compiler diagnostic message.

Related tasks
CALL statement (Enterprise COBOL for z/OS® Language Reference)
JAVA-CALLABLE (Enterprise COBOL for z/OS Language Reference)
JAVA-SHAREABLE (Enterprise COBOL for z/OS Language Reference)