Re: Trying to embed mozilla, can't getGREPathWithProperties

[email protected]
Newsgroups gmane.comp.mozilla.devel.java
Organization http://groups.google.com
Message-ID <1173459216.200058.204800__45035.7949165211$1173459618$gmane$org@q40g2000cwq.googlegroups.com>
Ok, two more pieces of information:

Replacing
File grePath = Mozilla.getGREPathWithProperties(range, null);
with
File grePath = new File("/Users/myname/sources/mozilla/obj-i686-apple-
darwin8.8.2/dist/XUL.framework/Versions/1.8.0.4");
i.e., the path to the javaxpcom.jar file, works fine. However,
naturally this is no good if I ever want to distribute this. So I
still need some way of getting the path properly.

Second, the unix command ' ./xulrunner-bin --find-gre 1.8.0.4' returns
the path to the libxpcom.dylib file, but the command './xulrunner-bin
--register-global' gives me:

"Registration not implemented on this platform!"

I assume that this is related to the source o my problems (though I
could be way off). Can I register and get GREs on a Mac?

Thanks for any help,
Sam

On Mar 9, 9:52 am, [email protected] wrote:
> Hi all,
>
> I'm trying to use XULRunner with JavaXPCOM to embed a mozilla
> application in my java program.
>
> I have built XULRunner on my Mac without any errors (I believe). I
> created a new Java application and added MozillaInterfaces.jaar to my
> classpath.
>
> The code below is from the 'Embedding Mozilla in a Java Application
> using JavaXPCOM' tutorial. As you can see it's not supposed to do
> anything -- just trying out things one step at a time. Unfortunately,
> a FileNotFoundException is caught when I use the line
>
> File grePath = Mozilla.getGREPathWithProperties(range, null);
>
> Does anyone know what I am doing wrong?
>
> Thanks so much for any help,
> Sam
>
> Code:
> --------
>
> public MozillaTest() {
>                 Mozilla mozilla = Mozilla.getInstance();
>                 GREVersionRange[] range = new GREVersionRange[1];
>                 range[0] = new GREVersionRange("1.8.0", true, "1.9", false);
>
>                 try {
>                         File grePath = Mozilla.getGREPathWithProperties(range, null);
>                         System.out.println("success");
>                 } catch (FileNotFoundException e) {
>                         // this exception is thrown if greGREPathWithProperties cannot find
>                         // a GRE
>
>                         System.out.println("fail: FileNotFoundException");
>                 }
>         }
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.