xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barbisch, Martin" <barbi...@sony.de>
Subject RE: Accessing my own Java classes from ECMAScript
Date Fri, 20 Sep 2002 12:17:21 GMT
Thanks J Aaron!

You lead me in the right direction. I just want to share two insights I got:


1) I have to use importClass() instead of importPackage().

     importClass(Packages.MyUsefulClass);

   (Probably since I just use a .class file (not within a package))


2) Executing Squiggle the following way did not work:

     java -cp lib -jar batik.jar

   Instead I had to execute it this way:

     java -cp lib;batik.jar org.apache.batik.apps.svgbrowser.Main

   (I copied my .class file to Batik's lib directory.)
   Changing the MANIFEST.MF file worked, too.


Have a nice weekend,

Martin



> -----Original Message-----
> From: J Aaron Farr [mailto:jaaronfarr@yahoo.com]
> Sent: Donnerstag, 19. September 2002 20:47
> To: Batik Users
> Subject: Re: Accessing my own Java classes from ECMAScript
> 
> 
> 
> Check out the Mozilla Rhino project documentation, for example:
> 
> http://www.mozilla.org/rhino/scriptjava.html
> 
> might be some help.
> 
> Specifically, your javascript for your example would have to 
> look like:
> 
> importPackage(Packages.MyUsefulClass);
> var muc = new Packages.MyUsefulClass();
> 
> You _MUST_ use the "Packages." prefix for any java classes 
> outside the normal
> jdk libaries.
> 
> Hope this helps.
> jaaron

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message