Trying to embed mozilla, can't getGREPathWithProperties
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <1173451926.194891.93370__27304.1680026383$1173454324$gmane$org@v33g2000cwv.googlegroups.com> |
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");
}
}