cannot use own commands

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

cannot use own commands

Martin Eklund

I'm completely new to BeanShell and am experiencing some difficulties. I
have written some java classes that I would like to add as commands in
BeanShell, which I do according to how I understand that you are
supposed to do it in the BeanShell manual:


Where test is both the name of the java class and the name of the
command and the path is the path to where the test.class file is
located. I'va also tried adding
source("/home/mek/workspace2/script/"); to the commands above.
However, regardless of what I do I get the following error: Sourced
file: inline evaluation of: ``test();'' : Command not found:
test()Problem During ExecutionSourced file: inline evaluation of:
``test();'' : Command not found: test() : at Line: 1 : in file: inline
evaluation of: ``test();'' : test ( )

I mocked around with this a couple of days ago and then I did get it to
work (beginners luck...). Could someone please tell me exactly the
syntax and the sequence of the commands I need to issue in order to
import self-written java classes as commands in BeanShell: Thank you!

Best regards,


Martin Eklund
PhD Student
Department of Pharmaceutical Biosciences
Uppsala University, Sweden
Ph: +46-18-4714281

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Beanshell-users mailing list
[hidden email]
Reply | Threaded
Open this post in threaded view

Re: cannot use own commands

Brian Deng
I believe you need to add your directory to the classpath and then
import the package. For example:


or move your scripts into a sub-directory such as "org/foo" and do
the following:



bdeng.vcf (178 bytes) Download Attachment