44 Building Java Applications for the iSeries Server with VisualAge for Java 3.5
If the required OS/400 options or LPPs are not installed on the system, you need to go
through the steps to manually install any missing OS/400 options or LPPs on your system.
For information about how to install the licensed programs or operating system, refer to the
software installation guide.
2.1.1 Setting up the Java version to use
Java system properties determine the environment in which the Java programs run. They are
similar to system values or environment variables in OS/400. A number of properties are set
when the Java virtual machine starts. The system properties are set to system default values.
The iSeries supports the use of multiple JDKs simultaneously, but only through multiple Java
virtual machines. A single Java virtual machine runs one specified JDK.
1. The java.version property determines which JDK to run. To determine the default JDK for
your system, open a Qshell session and use the
java -version command.
Figure 2-9 Determining the JDK version
2. As shown in Figure 2-10, if you want to change the default JDK, use the
SystemsDefault.properties file. This file can be used to override default Java settings. Add
an entry for the java.version property. The value you set will override the default setting.
Figure 2-10 Overriding the default JDK version setting in the SystemsDefault.properties file
3. Place the SystemsDefault.properties file in the /qibm/userdata/java400 directory of the
iSeries integrated file system. However, when you change the java.version property it has
no effect once a JVM is up and running.
4. You can also change the JDK to use at run time using a Java property. As shown in
Figure 2-11, open a Qshell session and use the property setting to set the desired JDK
Figure 2-11 Changing the JDK version at run time
2.2 Setting up the environment on the iSeries server
On the iSeries server, there is no requirement to set up any special environment to use the
Java support that the JDK provides. There is not an autoexec.bat file with a PATH
environment variable. Similar to any other standard JDKs, the IBM Developer Kit for Java
does not require that you have to change the CLASSPATH environment variable. The IBM
Developer Kit for Java can find the core Java classes as long as they are stored in the java.zip
and sun.zip files that are located in the /qibm/proddata/java400/jdk11x/lib subdirectory (x is
6,7 or 8). Starting with V4R4, the classes.zip file replaces the java.zip and sun.zip files. The
jdk 1.2 and 1.3 classes are found in the rt.jar file.
The iSeries JVM automatically searches all the classes it needs to load in the LIB
subdirectory that is located in the jdk directory on the iSeries integrated file system.
java -version
java version "1.2.2"
java -Djava.version=1.3 HelloWorld

Get Building Java Applications for the iSeries Server with VisualAge for Java 3.5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.