| 1 |
CamlJava - an OCaml/Java interface |
| 2 |
================================== |
| 3 |
|
| 4 |
DESCRIPTION: |
| 5 |
|
| 6 |
This is a very preliminary release of CamlJava, an OCaml/Java |
| 7 |
interface based on the following schema: |
| 8 |
|
| 9 |
Caml/C interface JNI (Java Native Interface) |
| 10 |
Caml <------------------> C <-----------------------------> Java |
| 11 |
|
| 12 |
Currently, CamlJava provides a low-level, weakly-typed OCaml interface |
| 13 |
very similar to the JNI. Java object references are mapped to an |
| 14 |
abstract type, and various JNI-like operations are provided to allow |
| 15 |
Java method invocation, field access, and more. A basic callback |
| 16 |
facility (allowing Java code to invoke methods on Caml objects) is |
| 17 |
also provided, although some stub Java code must be written by hand. |
| 18 |
|
| 19 |
In the future, a higher-level, strongly-typed interface will be |
| 20 |
provided, whereas Java classes are mapped directly to Caml classes. |
| 21 |
This raises fairly delicate type mapping issues, though, so don't hold |
| 22 |
your breath. |
| 23 |
|
| 24 |
|
| 25 |
REQUIREMENTS: |
| 26 |
|
| 27 |
- This release of CamlJava requires Objective Caml version 3.08 or later. |
| 28 |
|
| 29 |
- A Java implementation that supports JNI (Java Native Interface). |
| 30 |
So far, only Sun's JDK has been tested. |
| 31 |
|
| 32 |
INSTALLATION ON A UNIX PLATFORM: |
| 33 |
|
| 34 |
- Edit Makefile.config to define parameters depending on your Java |
| 35 |
installation. As distributed, the library is set up for |
| 36 |
Sun's JDK version 1.4.1 on a Linux x86 platform. |
| 37 |
|
| 38 |
- make |
| 39 |
become superuser |
| 40 |
make install |
| 41 |
|
| 42 |
- For testing: |
| 43 |
make tst |
| 44 |
|
| 45 |
|
| 46 |
INSTALLATION ON A WINDOWS PLATFORM: |
| 47 |
|
| 48 |
- Works with the MSVC port of OCaml for Windows. |
| 49 |
GNU make and Cygwin tools are required to do the installation. |
| 50 |
|
| 51 |
- Edit Makefile.config.msvc to define parameters depending on your Java |
| 52 |
installation. |
| 53 |
|
| 54 |
- make -f Makefile.msvc |
| 55 |
make -f Makefile.msvc install |
| 56 |
|
| 57 |
- For testing: |
| 58 |
make -f Makefile.msvc tst |
| 59 |
|
| 60 |
|
| 61 |
USAGE: |
| 62 |
|
| 63 |
The module is named "Jni". A good knowledge of the JNI is assumed; see Sun's |
| 64 |
JNI book or http://java.sun.com/products/jdk/1.2/docs/guide/jni/ |
| 65 |
Then, the comments in lib/jni.mli should make sense. |
| 66 |
|
| 67 |
Usage: ocamlc -I +camljava jni.cma ... |
| 68 |
or ocamlopt -I +camljava jni.cmxa ... |
| 69 |
|
| 70 |
See the programs in test/ for examples of use. |
| 71 |
|
| 72 |
|
| 73 |
LICENSE: GNU Library General Public License version 2. |
| 74 |
|
| 75 |
|
| 76 |
FEEDBACK: e-mail the author, [email protected]. |
| 77 |
|
| 78 |
|
| 79 |
|