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 [-h/--help] [-v/--verbose] [--version]
[-c/--coboldir <cobol-dir>]
[-d/--dlloutdir <dll-out-dir>]
[-i/--progid <program-id>] ...
[-j/--javaclassdir <java-class-dir>]
[-k/--cleanscript <cleanup-script-name>]
[-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.
<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 is called libapp1, when the argument to the -d option is a z/OS UNIX directory, or the DLL is called APP1, when 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.Note: Before Enterprise COBOL 6.5, the 3-character prefix LIB was added to the specified DLL name even when the DLL was targeted to an MVS PDS data set. Now that the prefix is no longer added in such cases, you need to update the link step of your build JCL to remove the LIB prefix when you refer to the associated DLL side deck file.
Options | Descriptions |
---|---|
--cleanscript <cleanup-script-name> -k
<cleanup-script-name> |
Customize the name of the cleanup script generated by the compiler. The user-specified
filename must end with '.sh'. This script is provided to assist the user to clean up the artifacts
generated by cjbuild in the directories indicated by the -c, -s, -j and -d directories. Option
--all-artifacts can be specified when invoking the cleanup script to cause the stub
files generated by the COBOL compiler to be removed as well. --force-clean can be
specified when invoking the cleanup script to remove all files in the current directory and
-c/--coboldir generated by all previous invocations of cjbuild and COBOL
Compiler.Default: |
--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: Note: This option is no longer
required for
cjbuild . The mode is now automatically deduced from the stub files.
Although you can still specify it, the value will be ignored unless it conflicts with the deduced
mode, in which case an error message will be issued. |
--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 |
--version |
Prints cjbuild version information. |
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)