[jruby-user] Shebang script with arguments

3 views
Skip to first unread message

Rodrigo Botafogo

unread,
Mar 30, 2015, 4:56:04 PM3/30/15
to us...@jruby.codehaus.org
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....

--
Rodrigo Botafogo



Charles Duffy

unread,
Mar 30, 2015, 5:05:44 PM3/30/15
to us...@jruby.codehaus.org
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".
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Rodrigo Botafogo

unread,
Mar 30, 2015, 5:13:02 PM3/30/15
to us...@jruby.codehaus.org
So, can I use shell variables? Any other solution? Any ideas?

Thanks,
--
Rodrigo Botafogo



Rodrigo Botafogo

unread,
Mar 30, 2015, 5:13:54 PM3/30/15
to us...@jruby.codehaus.org
Does JRUBY_OPTS helps in this case?  How do I use this?
--
Rodrigo Botafogo



Chris Seaton

unread,
Mar 30, 2015, 5:18:26 PM3/30/15
to us...@jruby.codehaus.org, Rodrigo Botafogo, Charles Duffy
You can have a second script that executes JRuby with the arguments you want, and use that in the shebang line.

Chris
Reply all
Reply to author
Forward
0 new messages