PageRenderTime 54ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/java/index.html

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