Get System Variable

Does anyone know how I can get a system variable like JAVA_HOME or
JBOSS_HOME from within a JRuby script?


Joshua S. Martin

ENV[‘JBOSS_HOME’] works normally, if it’s actually set via environment
variables.

Else, JBoss and Java both set some System Properties which you can
access via Java::java.lang.System.getProperty(…)

-Bob

On May 24, 2010, at 2:11 PM, Joshua M. wrote:

Does anyone know how I can get a system variable like JAVA_HOME or JBOSS_HOME from within a JRuby script?


Joshua S. Martin


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This is perfect! Thanks!

On Mon, May 24, 2010 at 2:21 PM, Bob McWhirter [email protected] wrote:

On May 24, 2010, at 2:11 PM, Joshua M. wrote:

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Joshua S. Martin

CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),
contains information that may be confidential, protected by the attorney
client or other legal privileges, and or proprietary non public
information.
If you are not an intended recipient of this message or an authorized
assistant to an intended recipient, please notify the sender by replying
to
this message and then delete it from your system. Use, dissemination,
distribution, or reproduction of this message and or any of its
attachments
(if any) by unintended recipients is not authorized and may be unlawful.

On May 24, 2010, at 1:21 PM, Bob McWhirter wrote:

Does anyone know how I can get a system variable like JAVA_HOME or JBOSS_HOME from within a JRuby script?


Joshua S. Martin

For JVM properties, also consider ENV_JAVA. It is faster than looking up
via getProperty every time.

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email