From: Charles Oliver Nutter Date: 2008-04-08T03:44:38+09:00 Subject: Re: Passing command line arguments to Ruby or JRuby script. Swati Sharma wrote: > Thanks Charlie. i made use of the ARGV array..... now, when i am passing > my parameters from java they are perfectly visible within the run method > of the thread. But they are not reaching my method in the ruby script > which is doing all the processing. I am making use of the JSR223 > scripting engine only. The invokeFunction method is the one that passes > the arguments from java to ruby. One possible reason that comes to my > mind is the absence of class in my script. is it neccessary to include a > class in the ruby script? ARGV is only set up using command-line parameters for the top-level "main" script you run. Any scripts that you invoke through BSF/JSR223 will require a separate step to set up ARGV there too. That could be as simple as running some code to add entries to ARGV. - Charlie