Compilation as described here probably only works on UNIX platforms.
As I have no experience with Windows systems it is possible that
there is somewhere UNIX specific code.
You need the following files and tools to be able to compile for JavaCaml:
To compile sources you must use the ocamlc command without the
-custom switch, and include the following additional options:
- The javacaml library. It is distributed as a directory containing
some (binary) files ending with .cmi, some (text) files ending
with .mli and a (binary) file javacaml.cma.
- The javacamlrun wrapper. This is simply a binary executable.
Example: To compile the source t.ml use the following command:
- Include -I followed by the directory containing the javacaml
- Include -use_runtime followed by the file name of the javacamlrun
ocamlc -I /usr/local/lib/ocaml/javacaml
The result is written into the file t. If you have a working Java
runtime system, you can simply execute t which is then run in the
Running the compiled executable as stand-alone application
As already mentioned, the bytecode file finds automatically its Java
runtime system (at least on UNIX platforms). If this does not work,
try the following:
java ocaml.Exec Name_of_bytecode_file
If this command does not find the "java" executable, check your
PATH. If it does not find the "ocaml.Exec" class, check your
CLASSPATH. Change the values entered in the javacamlrun configuration
section and compile this tool again.
Running the compiled executable as applet
See how to install JavaCaml on a Web