SWIG Java Examples$Header: /cvs/projects/SWIG/Examples/java/Attic/index.html,v 126.96.36.199.2.6 2002/07/28 20:31:31 cheetah Exp $
The following examples illustrate the use of SWIG with Java.
Running the examplesPlease see the Windows page in the main manual for information on using the examples on Windows.
On Unix 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.
A Unix example:
$ make $ export LD_LIBRARY_PATH=. #ksh $ java main
CompatibilityThe examples have been extensively tested on the following platforms: