Hi,

At Mon, 30 Sep 2002 15:29:51 +0900,
Raymond Lee wrote:
> I just downloaded jruby and looked at the samples, but I couldn't see
> documentations or samples show how to invoke Ruby scripts from Java
> applications. I tried
> Runtime.getRuntime().exec("jruby swing.rb"); , but it didn't work. Any
> ideas??

Can you run "jruby" from the command line?

I'm not sure about JRuby, however, using JRuby from Java
application doesn't mean importing JRuby package?  If you want
to run as separated process, you can use "ruby" instead of
"jruby" in your code.  Almost same.

> Also, is it possible to pass Java variables in Java program to jruby
> scripts. It needs some kind of bindings..

This code passes 1 to $foo in foo.rb.

	String[] args = new String[4];
	args[0] = "ruby";
	args[1] = "-s";
	args[2] = "foo.rb";
	args[3] = "-foo=1";
	Runtime.getRuntime().exec(args);

-- 
Nobu Nakada