Re: How to get access to Java code?

Javier Pedemonte <[email protected]>
Newsgroups gmane.comp.mozilla.devel.java
Message-ID <fqqdnS_3Bf3Q3SfYnZ2dnUVZ_s6onZ2d__43678.492474328$1169834144$gmane$org@mozilla.org>
JM wrote:
> I'm using xulrunner on a Linux box (Suse) which needs to have XPCom
> access to other modules. C++ side of things is going well, but I can't
> seem to access my (extensive legacy code that I'd really rather not
> re-write!) Java classes. From what I understand, I can't use XPConnect
> with XPCom objects written in Java yet.

Correct.  That is https://bugzilla.mozilla.org/show_bug.cgi?id=299263. 
Not done yet.

> Instead, I've just been trying
> to include my Java through an applet on a linked HTML page, which gave
> me problems. My current test is calling the following JS on startup:
> var aJavaList = new java.util.LinkedList(); alert(aJavaList.getClass);
> This returns the message 'Failed to create Java VM'. The JS works fine
> in the JS console opened from Firefox. Anyone able to help me out with
> where I'm going wrong? Alternative strategies for using Java from the
> xulrunner app would be greatly appreciated too.

Take a look at 
http://developer.mozilla.org/en/docs/Java_in_Firefox_Extensions.  This 
allows you to write a JavaScript XPCOM extension that loads Java.


javier
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.