Subj : Re: Accessing Java from JavaScript IN (Mozilla) BROWSER??? To : Merten Schumann From : Igor Bukanov Date : Thu Apr 29 2004 12:56 pm Merten Schumann wrote: > Hello, > > I'm trying to use Java within JavaScript code in a HTML page in Mozilla. > > Well, > var myString = new java.lang.String("Hello world"); > works fine (ok, I had to switch the "enable Java" option in Mozilla before:) > > Now I want to use a class (static method) from my own .jar. > I tried > var foo = Packages.my.own.Stuff.myMethod("hi") > but I always get > "Packages.my.own.Stuff.myMethod is not a function" > > I think my .jar file is simply not found since I'm sure the method is there > and the same error happens for any really non-existent package I tried to > address. > I tried to use the CLASSPATH environment variable, but the error still > appears. > > In a server application utilizing Rhino using third-party packages works > fine with the "Packages." stuff. > > Is it possible to use the "access Java packages from JavaScript" in Mozilla, > that means, on the client side? > Where to put .jar files? In Mozilla's plugin or component folder? Or should > it work via classpath? > > Thanx! > Alfred > > You posted to the wrong newsgroup/list, try netscape.public.mozilla.java and perhaps consider using an applet to load your jars. Regards, Igor .