When you run a Java™ program, you can select which mode you would like to use. All modes verify the code and create a Java program object to hold the preverified form of the program.
You can use any of the following modes:
Selection mode | Details |
---|---|
Interpreted | Each bytecode is interpreted at runtime. For information on running your Java program in the interpreted mode, see the Run Java (RUNJVA) command. |
Direct Processing | Machine instructions for a method are generated during the first call to that method, and saved for use the next time that the program runs. One copy is also shared for the entire system. For information on running your Java program using direct processing, see the Run Java (RUNJVA) command. |
Just-In-Time (JIT) compile | i5/OS™ interprets Java methods until reaching the threshold specified by the os400.jit.mmi.threshold Java system property. After reaching the threshold, i5/OS uses the JIT compiler to compile methods into native machine instructions. To use the Just-In-Time compiler, you need to set the compiler value to jitc. You can set the value by adding an environment variable or setting the java.compiler system property. Select one method from the list below to set the compiler value:
|
Just-In-Time (JIT) compile and Direct Processing | The most common way to use the Just-In-Time (JIT) compiler is with the jit_de option. When running with this option, programs that have already been optimized with direct processing run in direct processing mode. Programs that have not been optimized for direct optimization run in JIT mode. To use JIT and direct processing together, you need to set the compiler value to jitc_de. You can set the value by adding an environment variable or setting the java.compiler system property. Select one method from the following list to set the compiler value:
|
There are three ways that you can run a Java program (CL, QSH, and JNI). Each has a unique way to specify the mode. This table shows how that is done.
Mode | CL Command | QShell Command | JNI Invocation API |
---|---|---|---|
Interpret | INTERPRET(*YES) | -Djava.compiler=NONE -interpret | os400.run.mode=interpret |
DE | INTERPRET(*NO) | -Djava.compiler=NONE |
|
JIT | INTERPRET(*JIT) | -Djava.compiler=jitc | os400.run.mode=jitc |
JIT_DE(default) | INTERPRET(*OPTIMIZE) OPTIMIZE(*JIT) | -Djava.compiler=jitc_de | os400.run.mode=jitc_de |