CL Command Reference - CHGJVAPGM
CL Command List > CHGJVAPGM Reference
Description:
The Change Java Program (CHGJVAPGM) command changes attributes of Java programs(s) which are attached to Java class, ZIP, or JAR files.
The attributes that can be changed are the performance collection attribute and the following attributes that can control the size and performance of the Java programs: the optimization attribute, and the Licensed Internal Code optimization options attributes.
The CHGJVAPGM replaces existing Java programs only. Because of implicit creation of Java programs during run time, it is possible that only some classes in a ZIP or JAR file are represented in Java programs. This command will only change programs that already exist. The CRTJVAPGM command can be used to create programs for all classes in a ZIP or JAR file.
Restrictions: The file must be in one of the following file systems: QOpenSys, ¡åroot¡å, or a user-defined file system.
Examples:
Example 1: Change a Java Program to Interpreted
CHGJVAPGM CLSF(¡¯/projectA/myJavaclassname.class¡¯)
OPTIMIZE(*INTERPRET)
This command will change the Java program associated with the class file myJavaclassname so that the Java program will interpret the class file byte codes when invoked via the RUNJVA (Run Java) or JAVA CL command. The Java program is re-created only if the attributes specified differ from those of the current program.
Example 2: Change Optimized Java Programs in a JAR File
CHGJVAPGM CLSF(¡¯/projectA/myJavaAppfile.jar¡¯)
OPTIMIZE(10)
This command will change the Java programs associated with the Java archive (JAR) file myJavaAppfile. The Java program will contain compiled machine instruction sequences which will be run when the Java program is invoked by the RUNJVA (Run Java) or JAVA CL command.