Controlling how the Java Virtual Machine is set up
- You can place these options in the SystemDefault.properties file.
- You can use the CLASSPATH environment variable to specify the classpath (see above).
- You can place these options in an environment variable called
QIBM_RPG_JAVA_PROPERTIES. Any options placed in this environment variable
will override the options in the SystemDefault.properties file.
If you specify the java.class.path option in this environment variable,
and you also specified the CLASSPATH environment variable, it is undefined
which value will take precedence for the classpath. To specify options in the QIBM_RPG_JAVA_PROPERTIES environment variable, you code the options in a string, one after the other, separated by any character that does not appear in any of the options. Then you end the string with the separator character. For example, if you want to specify the options
then you would add the environment variable using the following command:java.version=1.4 os400.stderr=file:stderr.txt
ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPERTIES) VALUE('-Djava.version=1.4;-Dos400.stderr=file:stderr.txt;')
Some parameters and return values require conversion between the job CCSID and the CCSID that Java uses for byte arrays. The file.encoding Java property is used by RPG to obtain the CCSID that Java uses. Ensure that the file.encoding property is set correctly for your job CCSID. You can allow Java to set the property implicitly using attributes of your job, or you can set the property explicitly using one of the mechanisms above. For example, you could add '-Dfile.encoding=ISO8859_1' or '-Dfile.encoding=Cp948' to your QIBM_RPG_JAVA_PROPERTIES environment variable. For more information about the file.encoding property, see the IBM Developer Kit for Java topic in the Information Center.
For more information about the properties you can specify to control the Java virtual machine, and other environment variables that may be required for Java to operate correctly, such as the QIBM_USE_DESCRIPTOR_STDIO environment variable, see the see the IBM Developer Kit for Java topic in the Information Center. You may also need to consult the documentation for the specific Java classes that you will be using.