The Java™ transformer is an IBM® i5/OS™ component that preprocesses class files to prepare them to run using the iSeries™ Java virtual machine. The Java transformer creates an optimized program object that is persistent and is associated with the class file.
In the default case, the program object contains a compiled, 64-bit RISC machine instruction version of the class. The Java interpreter does not interpret the optimized program object at runtime. Instead, it directly runs when the class file is loaded.
Java programs are optimized using the JIT by default. To use the Java transformer, you either do CRTJVAPGM, or specify the use of the transformer on the RUNJVA or JAVA command.
You can use the Create Java Program (CRTJVAPGM) command to explicitly start the Java transformer. The CRTJVAPGM command optimizes the class file or JAR file while the command runs, so nothing needs to be done while the program is running. This improves the speed of the program the first time that it runs. Using the CRTJVAPGM command, instead of relying on default optimization, ensures the best optimization possible and also improves the use of space for the Java programs that are associated with the class file or JAR file.
Using the CRTJVAPGM command on a class file, JAR file, or ZIP file causes all the classes in the file to be optimized, and the resulting Java program object are persistent. This results in better runtime performance. You can also change the optimization level or select an optimization level other than the default of 10 by using the CRTJVAPGM command or the Change Java Program (CHGJVAPGM) command. At optimization level 40, interclass binding is performed between the classes within a JAR file, and in some cases, the classes are inlined. Interclass binding improves the call speed. Inlining removes the overhead of a method call entirely. In some cases, you can inline methods between classes within the JAR file or ZIP file. Specifying OPTIMIZE(*INTERPRET) on the CRTJVAPGM command causes any classes that are specified on the command to be verified and prepared to run in interpreted mode.
The Run Java (RUNJVA) command can also specify OPTIMIZE(*INTERPRET). This parameter specifies that any classes running under the Java virtual machine are interpreted, regardless of the optimization level of the associated program object. This is useful when debugging a class that was transformed with an optimization level of 40. To force interpretation, use INTERPRET(*YES).
See "Using cache for user class loaders" in Java performance considerations for information on reusing your Java programs created by class loaders.