CL Command Reference - CRTJVAPGM
CL Command List > CRTJVAPGM Reference
Description:
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.
Examples:
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.