Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] CamlJava w/ recent OCaml (3.11.1) and Sun's JVM (OpenJDK)

3 views
Skip to first unread message

Stefano Zacchiroli

unread,
Nov 23, 2009, 10:55:52 AM11/23/09
to OCaml Mailing List, Xavier Leroy
Has anyone successfully built/used CamlJava [1] with recent OCaml and
the open sourced Sun's JVM (OpenJDK)? I've tried for a while, but I'm
stuck at the basics, i.e. making the example shipped with CamlJava work.

First of all there is some needed gymnastic to build: apparently there
is no longer _a_ legacy libjvm.so, but several one depending on which
JRE you choose (at least: "Cacao" and "headless"). Of course they're in
different dirs and I'm not sure about which is the right way (or even
criteria) to choose one.

After having passed through that (with a dirty symlink to one of the two
libjvm.so), the shipped example fails with an exception while
initializing the JVM:

LOG: [0x00002b9a57f73c80] exception thrown while VM is initializing:
LOG: [0x00002b9a57f73c80] NULL: java.lang.Object
LOG: [0x00002b9a57f73c80] Aborting...

(this is with Cacao, with headless an exception its OCaml, but
apparently it is devoid of any inspectable content.)

Has any one here a success story to share?
Is there a planned future release of CamlJava?

Many thanks in advance,
Cheers.

[1] http://pauillac.inria.fr/~xleroy/software.html#camljava

--
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Dietro un grande uomo c'� ..| . |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...........| ..: |.... Je dis tu � tous ceux que j'aime

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Stefano Zacchiroli

unread,
Nov 24, 2009, 9:00:49 AM11/24/09
to OCaml Mailing List, Xavier Leroy
On Mon, Nov 23, 2009 at 04:55:37PM +0100, Stefano Zacchiroli wrote:
> Has anyone successfully built/used CamlJava [1] with recent OCaml and
> the open sourced Sun's JVM (OpenJDK)? I've tried for a while, but I'm
> stuck at the basics, i.e. making the example shipped with CamlJava work.
>
> First of all there is some needed gymnastic to build: apparently there
> is no longer _a_ legacy libjvm.so, but several one depending on which
> JRE you choose (at least: "Cacao" and "headless"). Of course they're in
> different dirs and I'm not sure about which is the right way (or even
> criteria) to choose one.

About this, here is a patch for the build system which makes CamlJava
build against both last Sun's JDK 6 (closed source) and last Open JDK.
It mainly account for libjvm.so having been moved around and some
upstream lib/ directory reorganization.

> After having passed through that (with a dirty symlink to one of the two
> libjvm.so), the shipped example fails with an exception while
> initializing the JVM:

This, unfortunately, is still standing :-(

Cheers.


PS I hope I'm not bothering with list + author's Cc, AFAIK there is no
BTS for CamlJava, so this is my best attempt for both being sure the
author gets the patch and that the patch is public for consumptions
by others

camljava-java6.patch

Stefano Zacchiroli

unread,
Dec 1, 2009, 5:53:00 AM12/1/09
to OCaml Mailing List, Grégoire Henry, Xavier Leroy
On Mon, Nov 23, 2009 at 04:55:37PM +0100, Stefano Zacchiroli wrote:
> Has anyone successfully built/used CamlJava [1] with recent OCaml and
> the open sourced Sun's JVM (OpenJDK)?

With the tremendous help of Gr�goire Henry, we've come up to a fixed
version of CamlJava that:

- works well with recent JVMs (both Sun's 1.6 and OpenJDK)
* fixes are both for building and for avoiding segfaults due to a
distinction among local and global references introduced by JNI 1.6
- is a bit more debugger friendly
- has _conditional_ automatic mapping of Java strings to OCaml strings
(needed by O'Jacare [1])
- is a bit more careful/strict in case of multithreading: you must
ensure all Java-OCaml callbacks are called from the very same thread
(need spotted by O'Jacare a while ago)
- fixes various minor issues that help packages

All patches are available at [2] and contain appropriate
descriptions.

The patches are integrated in the Debian package of CamlJava that I've
just uploaded to the archive. While the package gets processed for
copyright review, it is also available at:

deb http://people.debian.org/~zack/debian zack-unstable/
deb-src http://people.debian.org/~zack/debian zack-unstable/

Xavier: can you please consider integrating the above patches in a new
release of CamlJava?

AFAIK, a new release of O'Jacare based on the above work is being worked
on by Gr�goire.

Cheers.

[1] http://www.pps.jussieu.fr/~henry/ojacare/index.en.html
[2] http://git.debian.org/?p=pkg-ocaml-maint/packages/camljava.git;a=tree;f=debian/patches

0 new messages