Installing Java 5 on AIX

 

Downloading the AIX fileset

Click on the following link to download the Java 5 fileset.

http://www.ibm.com/developerworks/java/jdk/aix/service.html

From the table on this page choose either Java 5 32-bit or 64-bit

Also from the table check the minimum AIX level supported and ensure that your version of AIX is at the same or higher than this minimum value.

The version of AIX I installed Java on was 5.3 TL4 and therefore above the minimum. If you are below the minimum you will need to apply a later Technology Level (TL) to your version of AIX first.

To check what version of aix you are running type the following.

oslevel -r

5300-04

As can be seen from this example, this server is running AIX 5.3 TL04.

I this case I chose to download "Java 5 64-bit" because my version of AIX is 64 bit.

To check if your version of AIX is 32 or 64 bit type

bootinfo -K

32 or 64 should be returned

After clicking on the "Java 5 64-bit link" you are presented with a web page titled (at the time of writing) "IBM AIX Developer Kit and Runtime, Java Technology Edition", and you are asked to login. For this step you will need to register for an IBM account and password or use and existing one.

Once you have logged in you will need to agree to to the license conditions and then click "I confirm".

The next page gives you various downloads. I chose "Java5_64.sdk.tar.gz" and downloaded via http.

Unpacking the download

Check there is enough free space on your AIX server to copy and unpack the download in. Do this by typing the following.

df -g

This command will show you the filesystems and the free capacity. You will need a couple of hundred MB so choose a filesystem with enough free capacity.

Create a new directory in your chosen file system. For example.

mkdir java5_inst

Copy the download to this new directory on your AIX server using a utility such as scp or ftp. I used the free graphical utility "winSCP" which makes life a little easier.

Un-zip the file Java5_64.sdk.tar.gz by typing the following

gunzip Java5_64.sdk.tar.gz

Then un-tar the file by typing

tar xvf Java5_64.sdk.tar

The remaining file is the fileset to be installed.

Installing the Java 5 fileset

Create the table of contents file (.toc) by typing the following in the same directory as the just un-tared Java 5 file.

inutoc .

Next type smitty installp

And choose the option "Install Software" and press return.

                                                 Install and Update Software

Move cursor to desired item and press Enter.

  Install Software
  Update Installed Software to Latest Level (Update All)
  Install Software Bundle
  Update Software by Fix (APAR)
  Install and Update from ALL Available Software

Then type in the directory that contains the Java5 fileset and press return.

                                                       Install Software

Type or select a value for the entry field.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
* INPUT device / directory for software              [/var/java5_inst] 

Then ensure the fields are set to the following, ensuring that "PREVIEW only?" is set to yes to test the install, and press return.

                                                       Install Software

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
* INPUT device / directory for software               /var/java5_inst
* SOFTWARE to install                                [_all_latest]                                                       
  PREVIEW only? (install operation will NOT occur)    yes                                                                
  COMMIT software updates?                            yes                                                                
  SAVE replaced files?                                no                                                                 
  AUTOMATICALLY install requisite software?           yes                                                                
  EXTEND file systems if space needed?                yes                                                                  
  OVERWRITE same or newer versions?                   no                                                                  
  VERIFY install and check file sizes?                no                                                                  
  Include corresponding LANGUAGE filesets?            yes                                                                 
  DETAILED output?                                    no                                                                  
  Process multiple volumes?                           yes                                                                 
  ACCEPT new license agreements?                      yes                                                                
  Preview new LICENSE agreements?                     no    

If all goes well something similar the following should be displayed.

                                                  COMMAND STATUS

Command: OK            stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

[TOP]
geninstall -I "a -cgNpQqwXY -J"  -Z -p  -d /var/java5_inst -f File 2>&1

File:
   I:Java5_64.sdk                 5.0.0.290


*******************************************************************************
installp PREVIEW:  installation will not actually occur.
*******************************************************************************

+-----------------------------------------------------------------------------+
                    Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...

SUCCESSES
---------
  Filesets listed in this section passed pre-installation verification
  and will be installed.

  Selected Filesets
  -----------------
  Java5_64.sdk 5.0.0.290                      # Java SDK 64-bit

  << End of Success Section >>

FILESET STATISTICS
------------------
    1  Selected to be installed, of which:
        1  Passed pre-installation verification
  ----
    1  Total to be installed

RESOURCES
---------
  Estimated system resource requirements for filesets being installed:
                (All sizes are in 512-byte blocks)
      Filesystem                     Needed Space             Free Space
      /                                    1288                 155872
      /var                               174104                 241568
      -----                            --------                 ------
      TOTAL:                             175392                 397440

  NOTE:  "Needed Space" values are calculated from data available prior
  to installation.  These are the estimated resources required for the
  entire operation.  Further resource checks will be made during
  installation to verify that these initial estimates are sufficient.

******************************************************************************
End of installp PREVIEW.  No apply operation has actually occurred.
******************************************************************************

[BOTTOM]

If all is ok with the preview go back a page by pressing the escape key and number 3 key simultaneously and set the "PREVIEW only?" option to "no" and press return.

Check the output for errors, scroll down using the down arrow key.

The last page should show the summary of the installation, for example.

[MORE...75]
+-----------------------------------------------------------------------------+
Summaries:
+-----------------------------------------------------------------------------+

Installation Summary
--------------------
Name Level Part Event Result
-------------------------------------------------------------------------------
Java5_64.sdk 5.0.0.290 USR APPLY SUCCESS
Java5_64.sdk 5.0.0.290 ROOT APPLY SUCCESS

[BOTTOM] 

This show that Java 5 was installed correctly.

Testing the installation of Java

To check if the filesets are installed use the lslpp command as follows.

lslpp -l | grep -i java

Java14.sdk                1.4.2.20  COMMITTED  Java SDK 32-bit
  Java5_64.sdk             5.0.0.290  COMMITTED  Java SDK 64-bit
                             2.4.0.0  COMMITTED  RSCT GUI JAVA Msgs - U.S.
                             2.4.0.0  COMMITTED  RSCT RMC JAVA Msgs - U.S.
  Java5_64.sdk             5.0.0.290  COMMITTED  Java SDK 64-bit

As can be seen from the ouput above Java5_64.sdk has been installed. It can also be seen that an older version of Java is installed Java14.sdk.

Ok lets have a look at the version of java using the java command as follows.

java -version

java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM AIX build ca142-20050929a (SR3) (JIT enabled: jitc))

Not what we expected. Where has java5 gone?

To fix this we need to change the PATH variable to point to the java 5 installation and not the java 1.4 installation.

The PATH variable is defined in the /etc/environment file and can be modified using vi.

For example I changed this line.

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin

To this line.

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java5_64/jre/bin:/usr/java5_64/bin

After running java -version again we get the following.

java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pap64devifx-20100128a (SR11 FP1 ))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc64-64 j9vmap6423ifx-20100128 (JIT enabled)
J9VM - 20100122_52103_BHdSMr
JIT  - 20091016_1845ifx1_r8
GC   - 20091026_AA)
JCL  - 20100128

Finally don't forget to remove the old java tar files if you haven't done so already and the java installation files.