Browse thread
[ANN] OCaml-Java project : beta version
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2008-03-02 (10:53) |
From: | forum@x9c.fr <forum@x...> |
Subject: | Re: [Caml-list] [ANN] OCaml-Java project : beta version |
Le 1 mars 08 à 21:01, Adrien a écrit : > > Now about ocamljava, ocaml.jar immediately exits with "unable to > locate ocaml toplevel". I thought it did not need ocaml(.out). > > Also, ocamljava.jar has another problem : > java -jar bin\ocamljava.jar > Fatal error: exception > Sys_error("/usr/local/share/camomile/database/general_cat > egory.mar: java.io.IOException: file does not exist: > .\usr\local\share\camomile\ > database\general_category.mar") Well, I have to admit that I made some errors while crafting the binary package. I just fixed them and uploaded a new version (check out http://ocamljava.x9c.fr/downloads.html) . You should now be able to use the various tools. Here is a short test session assuming you have a "source.ml" file (typical content: <<let () = List.iter print_endline ["hello ..."; "... world"]>>): Execution of toplevel: java -jar ocaml.jar Compilation to OCaml bytecode: java -jar ocamlc.jar -o bc source.ml Execution of produced btyecode: java -jar ocamlrun.jar bc Compilation to Java jar file: java -jar ocamljava.jar -standalone -o prog.jar source.ml Execution of produced jar file: java -jar prog.jar However, I noticed a bug with the binary package that does not show up if you have the standard OCaml distribution installed on your computer: the ocamlc.jar/ocamljava.jar compilers will fail if the current directory contains the by-product of a previous compilation (e.g. cmo or cmi files). The temporary workaround is to delete these files before any compilation. I suspect this bug has something to do with the embedded mode (the ability for the Java-run programs to look for files inside their jar files rather than on the local file system). I will hunt this bug and report to the list when it is fixed. Sorry for the inconvenience in the meanwhile. Xavier Clerc