From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id B024BBBCB for ; Fri, 7 Mar 2008 16:51:47 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsAADPz0EfV+70qn2dsb2JhbACQeAEBAQEBBgQGCQgYmxQ X-IronPort-AV: E=Sophos;i="4.25,463,1199660400"; d="scan'208";a="9106907" Received: from 42.mail-out.ovh.net ([213.251.189.42]) by mail1-smtp-roc.national.inria.fr with SMTP; 07 Mar 2008 16:51:47 +0100 Received: (qmail 22305 invoked by uid 503); 7 Mar 2008 15:51:50 -0000 Received: from b6.ovh.net (HELO mail180.ha.ovh.net) (213.186.33.56) by 42.mail-out.ovh.net with SMTP; 7 Mar 2008 15:51:50 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 7 Mar 2008 15:51:44 -0000 Received: from mut38-5-82-246-191-110.fbx.proxad.net (HELO ?192.168.0.10?) (forum%x9c.fr@82.246.191.110) by ns0.ovh.net with SMTP; 7 Mar 2008 15:51:40 -0000 Message-Id: From: "forum@x9c.fr" To: caml-list@yquem.inria.fr In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: [Caml-list] Problem with OCamljava Date: Fri, 7 Mar 2008 16:51:43 +0100 References: X-Mailer: Apple Mail (2.919.2) X-Ovh-Remote: 82.246.191.110 (mut38-5-82-246-191-110.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam: no; 0.00; failwith:01 ocamlc:01 ocamlopt:01 compilation:01 bug:01 ocaml:01 ocamlc:01 ocaml:01 compilers:01 caml-list:01 int:01 ident:01 ident:01 expression:02 expression:02 Le 6 mars 08 =E0 12:25, Till Crueger a =E9crit : > Hi, > I have a Problem compiling with OCamljava. I first tried compiling =20 > everything at once, giving all sources directly to ocamljava.jar, =20 > 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 =20 > error came from. Some of the files gave me the same error as above, =20= > some did not. The most simple of the files producing this error was =20= > this one: > > type ident =3D > IdentVar of string > | IdentPtr of int > ;; > > let get_ptr =3D > function > IdentVar _ -> failwith "Uninitialized Variable" > | IdentPtr p -> p > ;; > > type primitive =3D > Inc > | Dec > | Put > | Get > | Print > | Zero > | Moveto of ident > ;; > > type expression =3D > 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 =20= > can shed some light on this. All works fine when using ocamlc/=20 > 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 =20 by the OCaml code. This trick (disabled by default) allows to deploy standalone =20 compilers, which means that ocamlc.jar / ocamljava.jar embed all the files they need. As a =20 result you do not even need to have the regular OCaml distribution to be installed on =20 your computer. Could you test your code with the newly updated version of the binary =20= package ? Xavier Clerc=