Java Interface

This interface allows AH Formatter V6.5 to be invoked from Java programs. Please refer to Java VM issues.

The Java Interface uses JNI (JavaNativeInterface).

CAUTION: 32-bit Windows version can be installed on Windows x64 Edition. In that case, please use JDK of the 32-bit version when you use Java interface.

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
XfoJavaCtl65.dllJava Interface Library for Windows [Install directory]
libXfoJavaCtl65.soJava Interface Library for Solaris [Install directory]/lib
libXfoJavaCtl65.soJava Interface Library for Linux [Install directory]/lib
libXfoJavaCtl65.jnilibJava Interface Library for Macintosh [Install directory]/lib

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 Linux / Solaris version, it must be included in the LD_LIBRARY_PATH environment variable. In Macintosh version, it must be included in the java.library.path . See also Environment Variables for the necessary environment variables.

Windows version:

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

Linux / Solaris 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

AH Formatter V6.5 Java Interface is built with Java SE 6 in Macintosh version, in other versions, J2SE5.0.

Using the interface in an application server

Since the native JNI library can be read by two or more Java VM class loaders, when using this interface in application servers, such as Tomcat, do not install the XfoJavaCtl.jar in the WEB-INF/lib of the WEB application. Set the interface to be read by class loaders (system class loader etc.) which only load 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

In Macintosh 64-bit version, the setting of java.library.path needs to be added in the java command as follows:

> java -Djava.library.path="[Install directory]/lib" sample sample.fo sample.pdf

API Specification

Please refer to the Javadoc documentation.