From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id DCA557ED6B for ; Sat, 11 Aug 2012 04:02:21 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of j.prevost@gmail.com) identity=pra; client-ip=209.85.216.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="j.prevost@gmail.com"; x-sender="j.prevost@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of j.prevost@gmail.com designates 209.85.216.182 as permitted sender) identity=mailfrom; client-ip=209.85.216.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="j.prevost@gmail.com"; x-sender="j.prevost@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qc0-f182.google.com) identity=helo; client-ip=209.85.216.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="j.prevost@gmail.com"; x-sender="postmaster@mail-qc0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AroBAJW8JVDRVdi2kGdsb2JhbABEuXMIIgEBAQEJCQ0bBCOCOQIJIwEbHQEDEgULXQERAQUBDgEuGodbAQMMmQsJA4wjgnKFBAoZJw1XiHEBBQyOS4McA5VJgRSNHj6EGg X-IronPort-AV: E=Sophos;i="4.77,749,1336341600"; d="scan'208";a="152867421" Received: from mail-qc0-f182.google.com ([209.85.216.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 11 Aug 2012 04:02:21 +0200 Received: by qcsg15 with SMTP id g15so2043733qcs.27 for ; Fri, 10 Aug 2012 19:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=GGoOBGHq3HABH4qCWA9enwW9Rv+LU1KT8rQ5tr68QTA=; b=0CxNh6R2bJls4DS7CTevic9BqAiXZv0R/baO6aUs7wN+qGO2xZca5D0fnAY6Z6TTJx cjZ82Asjp4XCDAkUlNsRa0zCSASd8DMzfAIQ4ctuVS8mLuyAzob4xI8kwnEkH4/BRjwR no90EN0mbfgp9ijpbJXCrdIJgfuXYw6KoYlBDXW17o4fZ0D/SwoYUM/X0vEqzqjdJ9qt +z2NO2jzGKu9jK2ar/GLFRVFRXwjr7tfHIBBUdmysQXKuj6UQ+AFPXkzTd7lGkI3jpru 8b3CGM32HnCnxpvby07YCSCi5tYqFBTx21m5vtYpTckm0GLIHcqgTeyOQ9XXoLbBvVN9 69jA== MIME-Version: 1.0 Received: by 10.229.106.130 with SMTP id x2mr2393000qco.121.1344650540004; Fri, 10 Aug 2012 19:02:20 -0700 (PDT) Received: by 10.49.12.75 with HTTP; Fri, 10 Aug 2012 19:02:19 -0700 (PDT) Date: Fri, 10 Aug 2012 22:02:19 -0400 Message-ID: From: John Prevost To: ocamljava@x9c.fr Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Validation-by: j.prevost@gmail.com Subject: Re: [Caml-list] OCaml-Java 2.0 preview: call for testers Tried this out on Windows under cygwin and had a couple of problems. CCing caml-list in case anybody else has run into similar. 1) There's some special code in bin/common to check for cygwin and use cygpath to convert JAVA_HOME to a UNIX-style path. That works... except in the case that there's a space in the path (which there almost certainly is on Windows). Each of the scripts (bin/ocaml bin/ocamljava, etc.) should use "$OCJ_JAVA" instead of $OCJ_JAVA (that is: quote the variable so that spaces aren't interpreted as separate tokens). With this change, the scripts call Java correctly. 1a) It might be appropriate to see if "java" is on the path and try to use that if JAVA_HOME is not set (as it was not on my machine). The batch files appear to do this already (and quote %OCJ_JAVA%, as well.) 2) With that change, ocamljava still didn't run right away. It appears to be because it's trying to parse the CLASSPATH environment variable, but it's using UNIX rules to do so. Since I don't know what's going on inside, I can't say exactly why, but I can report the error message: File "test.ml", line 1, characters 0-1: Error: Classpath error: ".;C" does not exist (This happens with whatever input is provided to ocamljava.) Two things here: 2a) It's interpreting the CLASSPATH as using : as a separator, whereas it's actually using ; as a separator. So, it sees ".;C:\..." and thinks the first segment is ".;C" 2b) Even though it's interpreting the CLASSPATH wrong, it probably still should not be an error for the CLASSPATH to contain paths that do not exist. Those should be ignored, rather than triggering an error. Finally, even though a stated goal is to be able to use Java's libraries from OCaml code, there doesn't seem to be any documentation on how to actually do that. I tried using external just in case, but if that's the mechanism I'm not sure how it's meant to be used. A little guidance on how to call into Java from OCaml would be appreciated. This would be helpful both to test that it works correctly and to figure out if the abstraction that's provided is adequate. Hope these comments help. John Prevost.