SWIG Java Examples

$Header: /cvs/projects/SWIG/Examples/java/Attic/index.html,v 1.1.2.4 2001/06/08 11:20:49 cheetah Exp $

The following examples illustrate the use of SWIG with Java.

Running the examples

Most of the examples work by making the Makefile before executing the program main.java. The Makefile will output the swig generated JNI c code as well as the java wrapper classes. Additionally the JNI c/c++ code is compiled into the shared object (dynamic link library) which is needed for dynamic linking to the native code. The Makefiles also compile the java files using javac.

Ensure that the dynamic link library file is in the appropriate path before executing the java program. For example in unix, libexample.so must be in the LD_LIBRARY_PATH.

An example:

$ make
$ export LD_LIBRARY_PATH=. #ksh 
$ java main

Compatibility

The examples have been extensively tested on the following platforms: All of the examples were last tested with the following configuration (28 May 2001): Your mileage may vary. If you experience a problem, please let us know by sending a message to swig-dev@cs.uchicago.edu.