Preparing your Java environment

Before you can compile and run Java™ applications that use the CCA Java Native Interface (JNI), you must install a Java version that is supported by your distribution.

Install Java from the distribution installation media or from other authorized sources for that distribution.

The CCA JNI has been tested with IBM Java version 1.8.0 for the distributions listed in Distribution-specific information.

Later versions of Java, as provided with a distribution, might work, although they have not been tested.

For compiling and running applications that use the CCA JNI, you need access to the java and javac executables. Use one of the following methods to ensure that you can call the command without preconditions:

  • Add the path to the java and javac executable to your PATH environment variable.
  • Create soft links from the java and javac executables from wherever they are located to a directory that is in your PATH environment variable by default, such as /usr/bin.
Note: IBM Java 1.7.0 interaction

Some users reported an issue with IBM Java, support item IV52646. The following exception occurs:


Exception in thread "main" java.lang.UnsatisfiedLinkError: nio
(/usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/s390x/libnio.so:
symbol NET_Bind, version SUNWprivate_1.1 not defined in file libnet.so
with link time reference)

This occurs because the s390x version of the libnio.so library is being loaded when aJava program is run. The correct version is:

/usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/s390/libnio.so

To ensure that the application uses the correct version, do the following in the application environment as a test, and then add an appropriate adjustment to the application environment file (such as .bashrc or .bash_profile):


export LD_LIBRARY_PATH=/usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/s390x:$LD_LIBRARY_PATH