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.
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.
The OPTIMIZE parameter is only used when creating Java programs for a target release prior to Version 6 Release 1 Modification 0. For target release V6R1M0 and later, the value is ignored and OPTIMIZE(*INTERPRET) is used.
As of V6R1M0, Java programs do not contain machine instructions. The class file is pre-verified and converted to an internal form. However the Java program is either interpreted from the bytecodes or else run with the Just In Time compiler (JIT).
For target releases prior to V6R1M0, the OPTIMIZE parameter specifies the optimization level of the Java program. When creating a Java program for a target release prior to V6R1M0, the value of the OPTIMIZE parameter is encapsulated within the Java program, but no machine instructions are generated. The encapsulated value of the OPTIMIZE parameter is used during Java program retranslation on the target release of the operating system.
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.
The ENBPFRCOL parameter is only used when creating Java programs for a target release prior to Version 6 Release 1 Modification 0. For target release V6R1M0 and later, the value is ignored and ENDPFRCOL(*NONE) is used.
For a target release prior to V6R1M0, the following values may be specified, but values *ENTRYEXIT and *FULL will not be effective until the Java program is retranslated on the target release of the operating system.
Top |
The PRFDTA parameter is outdated. The parameter value is ignored and PRFDTA(*NOCOL) is used.
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, V5R2M0 is version 5, 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 topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/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 topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Top |
Example 1: Create a Java Program
CRTJVAPGM CLSF('/projectA/myJavaclassname.class')
This command will create a Java program and associate it with the class file myJavaclassname. The Java program will contain pre-verified class file information which is used 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.
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 |