SAS®9 requires options be defined in the TKMVSENV file for SAS to run Java applications. There are four options. (Note: All of these TKMVSENV entries are prefixed "TKJNI"):
This entry is used to specify where your Java Runtime Environment (JRE) is located.
For example:
set TKJNI_OPT_LIBPATH=/java/bin/classic:/java/bin
If your JRE location is not correctly specified, an abend will occur similar to the abend in SAS Note 12595. The paths specified in TKJNI_OPT_LIBPATH are to libraries that contain JRE code used to start a Java Virtual Machine (JVM). The main one is called libjvm.so, but it uses many others.
Specifies that XPLink linkage will be used to call JVM. This entry must be set as follows:
set TKJNI_OPT_LEOPTS='XPLINK(ON)' asis
If this entry does not appear, an abend can occur similar to the abend in SAS Note 12595.
Specifies the location of an external link to the SAS executable that starts the Java Virtual Machine on z/OS. The external link is explained in the "Configuration Guide for SAS Foundation for z/OS." An example of a mixed case path specification:
set TKJNI_OPT_PROXYPATH=/usr/lpp/SAS/bin/jproxy
This entry is used to establish the location of an X server or X server pool. This option is used like a DISPLAY environment variable in UNIX System Services. It is required when Java is used to produce graphics. An example of this option: (Contact your network support group if you do not know what a valid X server or X server pool name is in your shop. The server name used here is provided only as an example for how to set.)
set TKJNI_OPT_DISPLAY='hires.fyi.sas.com:0'
If this is not a valid X server or X server pool location, the following error might occur in the SAS Log:
ERROR: Java class generated an exception.
In addition, the tkjni.err file found in your HFS home directory will contain a Java error message referring to the X11 window server. See the example below.
Exception in thread "Thread-1" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at at sun.awt.X11GraphicsEnvironment.<clinit> (X11GraphicsEnvironment.java:161).null(Unknown Source) at java.lang.Class.forName1(Native Method) at java.lang.Class.forName(Class.java:173) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment (GraphicsEnvironment.java:90) at java.awt.Window.init(Window.java:255) at java.awt.Window.<init>(Window.java:299) at java.awt.Frame.<init>(Frame.java:427) at java.awt.Frame.<init>(Frame.java:392) at com.sas.graphics.app.GraphSSR.render(Unknown Source) at com.sas.graphics.app.GraphSSR.main(Unknown Source)
Note: Also refer to SAS Note 12598 for information on incorrect JREOPTIONS= specifications.