Forum: JRuby Shebang script with arguments

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B97f192e676f1a67e0ef18f022671406?d=identicon&s=25 Rodrigo Botafogo (Guest)
on 2015-03-30 22:57
(Received via mailing list)
Hello...

I have a shebang script for jruby, and I need to change the java heap
space
in it.  How do I do that?  Is it possible?

Doing:

#!/usr/bin/env jruby -J-Xmx1024m

does not work.

I´ve seen a suggestion, that for Python the best would be to add the
parameter to a shell variable.  Can this be done for JRuby?


Thanks a lot....
5e2861b08f37fa306fbf5384994af688?d=identicon&s=25 Charles Duffy (Guest)
on 2015-03-30 23:06
(Received via mailing list)
POSIX doesn't generally allow more than one argument (other than the
interpreter name itself) to be passed as part of a shebang, so even if
your operating system supports this, it won't be portable: You've
already filled that one position with "jruby", since slot 0 is "env".

On Mon, Mar 30, 2015 at 3:55 PM, Rodrigo Botafogo
B97f192e676f1a67e0ef18f022671406?d=identicon&s=25 Rodrigo Botafogo (Guest)
on 2015-03-30 23:13
(Received via mailing list)
So, can I use shell variables? Any other solution? Any ideas?

Thanks,

2015-03-30 18:05 GMT-03:00 Charles Duffy <charles@dyfis.net>:
B97f192e676f1a67e0ef18f022671406?d=identicon&s=25 Rodrigo Botafogo (Guest)
on 2015-03-30 23:14
(Received via mailing list)
Does JRUBY_OPTS helps in this case?  How do I use this?

2015-03-30 18:12 GMT-03:00 Rodrigo Botafogo
<rodrigo@rodrigobotafogo.com>:
2b2507f727d700eb59819b3a2e0c4a24?d=identicon&s=25 Chris Seaton (Guest)
on 2015-03-30 23:19
(Received via mailing list)
You can have a second script that executes JRuby with the arguments you
want, and use that in the shebang line.

Chris
This topic is locked and can not be replied to.