Re: Trivial question about initial script sourced automatically for every JConsole.
Alexey Zinger <inline_four-/[email protected]> Mon, 21 Mar 2011 08:23:19 -0700 (PDT)
| Newsgroups | gmane.comp.java.beanshell.user |
|---|---|
| Message-ID | <[email protected]> |
You might wanna try something along these lines: bsh.getNameSpace().importCommands(commandStr); Here's what seems to be a similar real-world situation to yours. Alexey 2001 Honda CBR600F4i (CCS) 1998 Honda RS125 (CCS) 2002 Suzuki Bandit 1200S http://azinger.blogspot.com http://bsheet.sourceforge.net http://wcollage.sourceforge.net ________________________________ From: Gena Batsyan <[email protected]> To: beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Sent: Mon, March 21, 2011 11:11:04 AM Subject: [Beanshell-users] Trivial question about initial script sourced automatically for every JConsole. Hi everybody! I've got a small probably trivial problem with beanshell I'm trying to embed beanshell into my application by doing simple bsh.Interpreter i = new bsh.Interpreter(); i.eval("desktop()"); what I'm trying to do is to source an initial file into the interpreter so that the stuff defined therein is available immediately in any shell created in the desktop, and it just does not work. I've tried different things 1) before/after evaling desktop() in the code above I tried i.source("/pathto/boot.bsh"); 2) modified makeWorkspace() command in the distribution so that this.interpreter = new Interpreter( console ); + this.interpreter.source("/pathto/boot.bsh"); the functions defined in /pathto/boot.bsh are simply not there. However if i do source("/pathto/boot.bsh"); within the shell (in the desktop), everything is fine. It's pretty annoying pasting this every time, I would appreciate if anyone would have a suggestion... Thanks in advance! ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Beanshell-users mailing list Beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/beanshell-users ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d