Version française
Home     About     Download     Resources     Contact us    
Browse thread
Problem with OCamljava
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: forum@x9c.fr <forum@x...>
Subject: Re: [Caml-list] Problem with OCamljava

Le 6 mars 08 à 12:25, Till Crueger a écrit :

> Hi,
> I have a Problem compiling with OCamljava. I first tried compiling  
> everything at once, giving all sources directly to ocamljava.jar,  
> but I only got the error:
> "error in apply: java.lang.reflect.InvocationTargetException"
>
> Then I tried compiling the files each on its own to see where the  
> error came from. Some of the files gave me the same error as above,  
> some did not. The most simple of the files producing this error was  
> this one:
>
> type ident =
>      IdentVar of string
>   |  IdentPtr of int
>   ;;
>
> let get_ptr =
>   function
>      IdentVar _ -> failwith "Uninitialized Variable"
>   |  IdentPtr p -> p
>   ;;
>
> type primitive =
>      Inc
>   |  Dec
>   |  Put
>   |  Get
>   |  Print
>   |  Zero
>   |  Moveto of ident
>   ;;
>
> type expression =
>      ExpSequence of expression list
>   |  ExpPrim of primitive
>   |  ExpLoop of (ident * expression)
>   |  ExpDecl
>   ;;
>
> I don't really see what I am doing wrong here, so I hope one of you  
> can shed some light on this. All works fine when using ocamlc/ 
> ocamlopt for compilation.

You have probably been bitten by a bug related to the "embedded" mode.
The embedded mode allows a Java-compiled program to use a Java resource
(typically a file stored inside a jar file) when a file is requested  
by the OCaml code.
This trick (disabled by default) allows to deploy standalone  
compilers, which means
that ocamlc.jar / ocamljava.jar embed all the files they need. As a  
result you do not
even need to have the regular OCaml distribution to be installed on  
your computer.

Could you test your code with the newly updated version of the binary  
package ?


Xavier Clerc