Java Interface

This interface offers the way to use AH Formatter V5.0 from Java program. AH Formatter V5.0 Java Interface is available in Java 1.4.2 or 1.5 or later. Please refer to Java VM issues.

Java Interface is made using JNI (JavaNativeInterface).

Library files

The following library files are included in [Install directory] or [Install directory]/lib.

Library file Contents Location
XfoJavaCtl.jarJava Archiver [Install directory]/lib
XfoJavaCtl50.dllJava Interface Library for Windows [Install directory]
libXfoJavaCtl50.soJava Interface Library for Solaris [Install directory]/lib
libXfoJavaCtl50.soJava Interface Library for Linux
libXfoJavaCtl50.jnilibJava Interface Library for Macintosh
libXfoJavaCtl50.soJava Interface Library for AIX
libXfoJavaCtl50.so or
libXfoJavaCtl50.sl
Java Interface Library for HP-UX

In order to execute the Java Interface, directory of execute java and [Install directory]/lib/XfoJavaCtl.jar must be included in the CLASSPATH environment variable. In addition, from using JNI (JavaNativeInterface), in Windows version, [Install directory] must be included in the PATH environment variable. In the following environment,[Install directory]/lib must be included. In Solaris / Linux version, it must be included in the LD_LIBRARY_PATH environment variable. In Macintosh version, it must be included in the DYLD_LIBRARY_PATH environment variable. In HP-UX version, it must be included in the SHLIB_PATH environment variable. In AIX version, it must be included in the LIBPATH environment variable. See also Environment Variables for the necessary environment variables.

In Windows version:

> set CLASSPATH=[Install directory]/lib/XfoJavaCtl.jar;%CLASSPATH%
> set PATH=[Install directory];%PATH%

In Solaris / Linux version:

$ CLASSPATH=[Install directory]/lib/XfoJavaCtl.jar:${CLASSPATH}
$ export CLASSPATH
$ LD_LIBRARY_PATH=[Install directory]/lib:${LD_LIBRARY_PATH}
$ export LD_LIBRARY_PATH

Java VM issues

The HP-UX version and the AIX version are built using Java 1.4.2. The other platforms are built using Java 1.5. The Java runtime environment below v1.4.2 is not supported.

About the use in an application server

When you use this interface in application servers, such as Tomcat, please do not put XfoJavaCtl.jar on WEB-INF/lib of WEB application.
Since the native library of JNI can be read from two or more class loaders with the specification of JavaVM, if XfoJavaCtl.jar is put on each WEB application directory, it becomes impossible to use it from two or more WEB applications. Please set up to make it read by the class loaders (system class loader etc.) which load only at once.

Running the Sample Program

[Install directory]/samples/java contains several simple sample programs.

The following shows how to execute these sample programs. In this case [Install directory]/samples/java must be included in CLASSPATH.

> cd [Install directory]/samples/java
> javac sample.java
> java sample sample.fo sample.pdf

API Specification

Please refer to the document that was generated by Javadoc.