Re: calling java from a javascript XPCOM component

From: David Huynh <>
Date: Thu, 08 Dec 2005 13:52:11 -0500

Andrew Harrison wrote:

> Hi David,
> Thanks for this. I decided to get to Java via C++ because I didn't
> want to go via a webpage. I was writing a protocol handler, so your
> technique of using LiveConnect didn't work for me.

I think it's actually possible to write a protocol handler in
Javascript. And you can get to Java from Javascript code inside XUL
rather than inside HTML.

> There are some similarities to your method however. I had to get to
> the already initialized JVM that is loaded with the browser, so I
> couldn't set a classpath like you would normally do with JNI when
> creating a JVM. Instead I have to get a URLClassLoader and pass it
> the libs and classes to load.
> I've been listening to the discussions on this list since my initial
> query and it's very interesting. My protocol handler calls back to a
> P2P framework we're developing (at Cardiff, Wales, UK). The aim of
> the extension is to allow publishing and discovery of resources in a
> decentralised manner - i.e. your browser becomes a Peer. This issue
> has been touched upon in the list with regards to Semantic Bank. I'd
> like to tie in my stuff with Piggy Bank when I get the time.
> Unfortunately I'm having to work on this firefox stuff 'out of hours'
> so progress is patchy, but hopefully I'll have something going in
> the new year. I'll let you know.

Awesome! Looking forward to see it :-)

Received on Thu Dec 08 2005 - 18:43:28 EST

This archive was generated by hypermail 2.3.0 : Thu Aug 09 2012 - 16:39:18 EDT