On Jan 19, 12:40 pm, Norris Boyd <[EMAIL PROTECTED]> wrote:
> On Jan 19, 7:00 am, tlrobinson <[EMAIL PROTECTED]> wrote:
> > I too am wondering how to use external libraries with Rhino. I've
> > tried putting the .jar in my classpath and using the
> > java.com.domain.packagename syntax, but no such luck.
>
> > Thank you.
>
> If you have a class com.foo.Bar, then you load it by
> "Packages.com.foo.Bar". "java.com.foo.Bar" would only work if your
> class was really a subpackage of "java".
>
> 1.7 will include a top-level definition for "com", among others. Once
> 1.7 is released you'll be able to load com.foo.Bar using com.foo.Bar.
>
> --N

I'm trying to use Xerces:

    js> var doc = new Packages.org.apache.xerces.dom.DocumentImpl();
    js: "<stdin>", line 2: uncaught JavaScript runtime exception:
TypeError: [JavaPackage org.apache.xerces.dom.DocumentImpl] is not a
function, it is org.mozilla.javascript.NativeJavaPackage.

xercesImpl.jar is in my classpath, and the equivalent in Java works
fine:

    org.w3c.dom.Document doc = new
org.apache.xerces.dom.DocumentImpl();

Thanks for your help.
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to