Set Java Version on iSeries(AS400) - Also check default java version

Update: For iSeries (AS400) V7R1 Java version and setup click here


First find out what java version is the default when you sign on

There are two ways to do that ...
1) Type java *version on command line and press ENTER. Here is the output
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)
Classic VM (build 1.4, build JDK-1.4, native threads, jitc_de)
Java program completed

OR

2) Go into Qshell using QSH command and then type java -version and you will get the same output
java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)
Classic VM (build 1.4, build JDK-1.4, native threads, jitc_de)
$


Where is the default value for the Java Version setup on the iSeries(As400)?


For that you have to check the file systemdefault.properties. The path for that file is
/QIBM/UserData/Java400/systemdefault.properties

This is a like any other properties file in java with name and value pairs.
The entry that you are looking for is
java.version=1.4
Or if you want it to set to java version 1.5 then you will update that entry to
java.version=1.5

Tip: Here is a very quick and easy way to create and populate the file with one command:
QSH CMD('echo java.version=1.4 > /QIBM/UserData/Java400/SystemDefault.properties')
 
Remember this will change the default java version for any java application running on iSeries unless there is an override. Also you cannot just change the value to anything and it will just work you have to make sure that version of Java is already installed on the machine. If they are not you have ask your operation personnel to load it.

How to check what java versions are available on iSeries(AS400)?

Type command GO LICPGM and look for installed JDKs
5722JV1   *COMPATIBLE  Java Developer Kit 1.3     
5722JV1   *COMPATIBLE  Java Developer Kit 1.4     
5722JV1   *COMPATIBLE  Java Developer Kit 5.0  

OR

Go to IFS directory path /QIBM/ProdData/Java400
Type Command WRKLNK OBJ('/QIBM/ProdData/Java400') , check subdirectories
Opt   Object link            Type
      ext                    DIR
      fonts                  DIR
      jdk13                  DIR 
      jdk14                  DIR 
      jdk15                  DIR

How to set default java version for a specific user on iSeries(AS400)?


Update the Home Directory for the user profile to your own unique IFS folder
Home directory . . . . . . . . . HOMEDIR        *SAME

Then copy the systemdefault.properties file into that folder and set the java version.

How to set java version during JAVA and RUNJVA call?

Just set the parameter Properties: PROP, example
PROP((java.version '1.4'))

How to set the java version using environment variable?

Java environment variable is JAVA_HOME
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QIBM/ProdData/Java400/jdk15')

No comments:

Post a Comment

NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.