Open Babel for Java (JNI) 0.9
--------------------

This directory contains a set of SWIG-generated interface classes for
using the Open Babel C++ library from Java. It is currently
experimental and has not been thoroughly tested.

The Open Babel wiki pages on Java give information on compiling and
running Java programs with Open Babel:
http://openbabel.sourceforge.net/wiki/Java

*** Linux Compilation

To compile on Debian 4.0, run the following steps:
$ export JAVA=/home/noel/Tools/jdk1.5.0_15

I installed OB into /home/noel/tree (/lib)
$ export tree=/home/noel/tree 

$ cd /home/noel/Tools/openbabel/scripts/java
$ $JAVA/bin/javac *.java
$ g++ -c -fpic openbabel_java.cpp -I../../include -I$JAVA/include -I$JAVA/include/linux
$ g++ -shared -L$tree/lib openbabel_java.o -lopenbabel -o libopenbabel.so
$ export LD_LIBRARY_PATH=.:$tree/lib
$ LD_PRELOAD=$tree/lib/libopenbabel.so $JAVA/bin/java OBTest


*** Mac OS X Compliation

% javac *.java
% g++ -c -I/System/Library/Frameworks/JavaVM.framework/Headers \
openbabel_java.cpp
% g++ -dynamiclib -o libopenbabel.jnilib openbabel_java.o \
-framework JavaVM -L/usr/local/lib -lopenbabel


*** Running Programs

To run the OBTest program:
% java OBTest

