Re: [Objectscript-users] Embedding java. Examples. More
Brought to you by:
rob_d_clark
From: Rob C. <ro...@ti...> - 2005-09-13 05:18:13
|
I think you need the two declareJavaPackage() line's uncommented... or, from java you can just call oscript.data.JavaPackageWrapper.declarePackage("com.novatecnologias") or you can just create an initialize.os where you dump all the needed declareJavaPackage() calls, and then eval() this file at startup... it would be faster to put stuff in a .os file that gets loaded at startup, since the file will get compiled to a java classfile the first time it is executed, so the parser does not need to run each subsequent time. -- Rob On Sep 12, 2005, at 12:09 PM, Sergio Szychowski wrote: > Hi, > > I trying to embed some scripts files but I have some errors and I > can't > figure how to fix them. > > > Some examples. > > > Scope a = new BasicScope( OscriptInterpreter.getGlobalScope() ); > > //OscriptInterpreter.eval("pkg.system.declareJavaPackage > (\"com.novatecnologias\");",a); > > //OscriptInterpreter.eval("pkg.system.declareJavaPackage > (\"com.novatecnologias.xf\");",a); > > OscriptInterpreter.eval("var com = new JavaPackage(\"com\");", a); > > > OscriptInterpreter.eval("var > owner=com.novatecnologias.xf.pruabmBsh();",a); > //I hate netscape > > AbstractFile file =OscriptInterpreter.resolve("javax/ > abm_cli.os",false); > > OscriptInterpreter.eval( file, a ); > > oscript.exceptions.PackagedScriptObjectException: > NoSuchMemberException: > no such member: JavaPackage: novatecnologias > at var owner = com.novatecnologias.xf.pruabmBsh(); > (/.tmp/0.2654966460115943/string-input.os:1) > > Greetings > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/ > bsce5sf > _______________________________________________ > Objectscript-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectscript-users > -- Rob ____________________ CONTACT INFORMATION: email: ro...@ti... IM: rob@sandjabber desk: 1 858 552 2946 cell: 1 619 300 9661 |