Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Create Java Program (CRTJVAPGM) command creates a Java program from a Java class file, JAR file, or ZIP file. The resulting Java program object becomes part of the class file, JAR file or ZIP file object. The Java program runs when started by the JAVA (Run Java Program) command. The size and performance of the Java program can be controlled through use of the OPTIMIZE and LICOPT parameters.
If a JAR file or ZIP file is specified, only one Java program is created and associated with this file. The Java program contains an optimized internal form for all of the classes in the JAR file or ZIP file.
Restrictions: The file must be in one of the following file systems: QOpenSys,"root", or a user-defined file system.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
CLSF | Class file or JAR file | Path name | Required, Positional 1 |
CLASSPATH | Classpath | Path name, *NONE, *ENVVAR | Optional |
JDKVER | Java developer kit version | Character value, *NONE | Optional |
OPTIMIZE | Optimization | 10, *INTERPRET, 20, 30, 40 | Optional |
USRPRF | User profile | *USER, *OWNER | Optional |
USEADPAUT | Use adopted authority | *NO, *YES | Optional |
REPLACE | Replace program | *YES, *NO | Optional |
ENBPFRCOL | Enable performance collection | *NONE, *ENTRYEXIT, *FULL | Optional |
PRFDTA | Profiling data | *NOCOL, *COL | Optional |
SUBTREE | Directory subtree | *NONE, *ALL | Optional |
TGTRLS | Target release | Character value, *CURRENT | Optional |
LICOPT | Licensed Internal Code options | Character value, *OPTIMIZE | Optional |
LICOPTFILE | LIC options file | Path name, *NONE | Optional |
Top |
Specifies the class file , JAR file, or ZIP file name from which to create the Java program. The file name may be qualified by one or more directory names.
Top |
Specifies the path used to locate classes for inter-JAR binding. Directories are separated by colons.
Either CLASSPATH or JDKVER must be specified for inter-JAR binding to occur. CLASSPATH must be *NONE when CLSF is a class file.
Top |
Specifies the Java Development Kit (JDK) version to add to the class path for locating classes for inter-JAR binding.
Either CLASSPATH or JDKVER must be specified for inter-JAR binding to occur. JDKVER must be *NONE when CLSF is a class file.
Top |
Specifies the optimization level of the Java program. For OPTIMIZE(*INTERPRET), the resulting Java program will be pre-verified and converted to an internal form. Then, it will be interpreted when it runs. For other optimization levels, the Java program contains server machine instruction sequences that are run when the Java program is invoked. These server machine instructions have been optimized based on the specified optimization level. The server directly runs the machine instructions when the program runs.
OPTIMIZE(*INTERPRET) Java programs are smaller but run slower than Java programs created with higher optimization levels. As the optimization level is increased beyond 10, the Java program performance generally improves, but the time required to create the Java program increases and debugging is more difficult.
Top |
Specifies whether the authority checking done while this program is running should include only the user who is running the program (*USER) or both the user who is running the program and the program owner (*OWNER). The profiles of the program user or both the program user and the program owner are used to control which objects can be used by the program, including the authority the program has for each object. Only the program owner or a user with QSECOFR authority can change the user profile attribute.
Top |
Specifies whether program adopted authority from previous programs in the call stack will be used as a source of authority when this program is running.
Top |
Specifies whether an existing Java program associated with this file is replaced with the new Java program being created.
Top |
Specifies whether collection of performance data is enabled.
Top |
Specifies the program profiling data attribute for the module. Program profiling is an advanced optimization technique to reorder procedures and code within the procedures based on statistical data (profiling data)
Note: *COL can be specified only when the optimization level of the Java program is 30 or greater and is not being changed.
Top |
Specifies whether directory subtrees are processed when looking for files that match the CLSF keyword.
Top |
Specifies the release of the operating system on which you intend to use the object being created. When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V4R2M0 is version 4, release 2, modification level 0.
Valid values depend on the current version, release, and modification level, and they change with each new release.
Top |
Specifies one or more Licensed Internal Code compile-time options. This parameter allows individual compile-time options to be selected, and is intended for the advanced programmer who understands the potential benefits and drawbacks of each selected type of compiler option.
Note: Additional information about the LICOPT options can be found in the IBM Developer Kit for Java reference in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies a file name which lists one or more Licensed Internal Code compile-time options.
Note: Additional information about the LICOPT options can be found in the IBM Developer Kit for Java reference in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Example 1: Create an Optimized Java Program
CRTJVAPGM CLSF('/projectA/myJavaclassname.class') OPTIMIZE(10)
This command will create a Java program and associate it with the class file myJavaclassname. The Java program will contain compiled machine instruction sequences which will be run when the Java program is invoked via the RUNJVA (Run Java) or the JAVA CL command.
Example 2: Create a Java Program Specifying a LICOPT File
CRTJVAPGM CLSF('/projectA/myJavaclassname.class') LICOPTFILE('/projectA/mylicoptfile.txt')
This command will create a Java program and associate it with the class file myJavaclassname. The command will read the Licensed Internal Code options contained in the text file mylicoptfile.txt and prepend them to the default Licensed Internal Code Options used when generating compiled machine instruction sequences.
Example 3: Create Numerous Java Programs
CRTJVAPGM CLSF('/projectA/*.class') SUBTREE(*ALL)
This command will create a Java program and associate it with any class file in the projectA directory and any class file in directories below projectA.
Top |
*ESCAPE Messages
Top |