Passing ruby parameters to compiled jruby code

Hello,

Hopefully this isn’t a silly question. I wasn’t able to find an answer
in the documentation.

Suppose I have some jruby code that runs in 1.9 mode, so I run it with

Jruby --1.9 program.rb

If I compile it with jrubyc, I’ll end up with program.class, which I can
run

Java program

But how do I pass the --1.9 switch to the compiled program?

Thanks,

glauber


Glauber Ribeiro
Information Security and Infrastructure
Experian Automotive – Schaumburg, IL

maybe

jruby --1.9 program.class

works as expected.

regards, Kristian

On Fri, Mar 25, 2011 at 9:31 PM, Ribeiro, Glauber

You can also set the Java property:

jruby.compat.version=RUBY1_8|RUBY1_9

See ‘jruby --properties’ to see more.

Of course! Setting the properties is the way to go.

Thanks,

g