cjbuild command reference
The cjbuild utility is provided to assist with building non-OO COBOL applications that interoperate with Java™. When the COBOL files of such an application are compiled, stub files are produced that facilitate the communication between COBOL and Java. These stub files must be built into a DLL that is available when the application runs.
cjbuild command usage and parameter descriptions
Execute the following command to run the cjbuild utility:
cjbuild [-hv]
[-c/--coboldir <cobol-dir>]
[-d/--dlloutdir <dll-out-dir>]
[-i/--progid <program-id>] ...
[-j/--javaclassdir <java-class-dir>]
[-m/--mode PURE31|PURE64|MIX_31_64]
[-p/--pkgname <package-name>]
[-r/--jar <jar-file>]
[-s/--javasrcdir <java-src-dir>]
[<program-file>] <lib-base-name>
where:<program-file>
- Note: This argument was called <methods-file> in previous versions of cjbuild and was a mandatory argument. It is now optional.
![Start of change](../delta.gif)
<lib-base-name>
- Used to create the name of the DLL that contains the stub code needed at run time by the
interoperable application (both Java and COBOL may need this DLL). This name is also used as the
base name for the .jar file created when the -r/--jar option is not specified and the .jar file name
defaults. For example, If
<lib-base-name>
is app1, then the DLL will be called libapp1.so if the argument to the -d option is a z/OS UNIX directory, or LIBAPP1 if the argument to the -d option is an MVS PDS data set. The .jar file created when the--jar <jar-file>
option is not specified is libapp1.jar.
![End of change](../deltaend.gif)
Options | Descriptions |
---|---|
--coboldir <cobol-dir> -c
<cobol-dir> |
Path to COBOL artifact directory. This directory contains files generated by the compiler
when compiling COBOL programs that contain the JAVA-CALLABLE and/or
JAVA-SHAREABLE directives or CALL statements with a literal call
target of the form 'Java.java-class-name.java-static-method-name '.".Default: current directory |
--dlloutdir <dll-out-dir> -d
<dll-out-dir> |
Path where the DLL of stub code is to be placed. For a PDS, use the path of the
form:
For
example:
Default: current directory |
--help -h |
Displays verbose help. Default: N/A |
![]() --progid <program-id> -i ![]() |
![]() Indicates the name of a COBOL program whose stub files in the directory indicated by the -c/--coboldir option are to be processed by cjbuild. The option can be specified multiple times, once for each program to be included in cjbuild's processing. It is similar to the <program-file> argument, which serves the same purpose, but -i allows you to provide the same information to cjbuild on the command line instead of in an input file. <program-id> corresponds to the name of the COBOL program as specified in the program-id clause of the program. If the name is specified without quotes in the COBOL program, then the name should be specified with all upper case letters in the -i option. If the name is specified as a literal in the COBOL program, then the case of characters specified in the -i option should match exactly with the program-id clause in the COBOL program. Default: N/A ![]() |
--javaclassdir <java-class-dir> |
Path to location of output class files for generated Java code. This path should be in your CLASSPATH environment variable. Default: current directory |
--javasrcdir <java-src-dir> -s
<java-src-dir> |
Path to location of output Java source files. Default: current directory |
![]() --jar <jar-file> -r ![]() |
![]() Create a Java .jar file from any .class files generated from compiling Java source files produced by the COBOL compiler and cjbuild. The .jar file will have the name as indicated by the <jar-file> argument. The .jar file should be in your Java CLASSPATH at run time. Default: a jar file with name lib<lib-base-name>.jar is created in the current directory. ![]() |
--mode <PURE31|PURE64|MIX_31_64> |
Java/COBOL interoperability mode. Specify Specify Specify
MIX_31_64 for AMODE 31 COBOL/64-bit Java application.Note: You must build COBOL files with
JAVAIOP(JAVA64) option for
MIX_31_64 mode applications.Default:
|
--pkgname <package-name> |
Name of package with which these native methods will be associated. Each application should
have its own package name. For example:
Three
classes will be created as part of this package:
Default:
|
--verbose |
Verbose output. Shows compile/link commands executed. Default: N/A |
Compiling, linking, and running non-OO COBOL applications that interoperate with Java
Example: COBPROD application - building and running
JAVA-CALLBALE (Enterprise COBOL for z/OS Language Reference)
JAVA-SHAREABLE (Enterprise COBOL for z/OS Language Reference)
CALL statement (Enterprise COBOL for z/OS Language Reference)