PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/java/index.html

#
HTML | 65 lines | 53 code | 12 blank | 0 comment | 0 complexity | 9aeb62e4bbb420a2c0b15cb04bee562b MD5 | raw file
 1<html>
 2<head>
 3<title>SWIG:Examples:java</title>
 4</head>
 5
 6<body bgcolor="#ffffff">
 7<H1>SWIG Java Examples</H1>
 8
 9<p>
10The following examples illustrate the use of SWIG with Java.
11
12<ul>
13<li><a href="simple/index.html">simple</a>.  A minimal example showing how SWIG can
14be used to wrap a C function, a global variable, and a constant.
15<li><a href="native/index.html">native</a>. Comparing the manual and the SWIG approach to calling native code.
16<li><a href="typemap/index.html">typemap</a>. Modifying the Java module's default behaviour by using typemaps.
17<li><a href="constants/index.html">constants</a>.  This shows how preprocessor macros and
18certain C declarations are turned into constants.
19<li><a href="variables/index.html">variables</a>. An example showing how to access C global variables.
20<li><a href="enum/index.html">enum</a>. Wrapping enumerations.
21<li><a href="class/index.html">class</a>. How to wrap a simple C++ class.
22<li><a href="reference/index.html">reference</a>. C++ references.
23<li><a href="pointer/index.html">pointer</a>. Simple pointer handling.
24<li><a href="template/index.html">template</a>. C++ templates.
25<li><a href="funcptr/index.html">funcptr</a>. Pointers to functions.
26<li><a href="callback/index.html">callback</a>. C++ callbacks using directors.
27<li><a href="extend/index.html">extend</a>. Polymorphism using directors.
28</ul>
29
30<h2>Running the examples</h2>
31Please see the <a href="../../Doc/Manual/Windows.html">Windows</a> page in the main manual for information on using the examples on Windows. <p>
32
33On Unix most of the examples work by making the Makefile before executing the program runme.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. 
34<p>
35Ensure 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. 
36<p>
37A Unix example:
38<blockquote>
39<pre>
40$ make
41$ export LD_LIBRARY_PATH=. #ksh 
42$ java runme
43</pre>
44</blockquote>
45<p>
46
47</ul>
48
49<h2>Compatibility</h2>
50
51The examples have been extensively tested on the following platforms:
52
53<ul>
54<li>Solaris
55<li>Linux
56<li>Cygwin
57<li>Windows
58</ul>
59
60Your mileage may vary.  If you experience a problem, please let us know by 
61contacting us on the <a href="http://www.swig.org/mail.html">mailing lists</a>.
62</body>
63</html>
64
65