Detect on which OS jruby is running


#1

Hi all,

I’d like to know if there is a safe and standard way to detect on which
OS jruby is running. The RUBY_PLATFORM constant doesn’t seem to be very
useful in this case.

Thanks in advance.
Andrea


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

Hi Anrdea,

Sure, use rbconfig:

jruby -e “require ‘rbconfig’; p Config::CONFIG[‘target_os’]”

It will print out the OS name, e.g.:
“mswin”

Thanks,
–Vladimir

On Tue, Mar 31, 2009 at 9:52 PM, Andrea F. removed_email_address@domain.invalid
wrote:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#3

Or you could:

jruby -e “include Java; puts java.lang.System.getProperty(‘os.name’)”

On Tue, Mar 31, 2009 at 12:57 PM, Vladimir S. removed_email_address@domain.invalid
wrote:

–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#4

Il giorno mar, 31/03/2009 alle 16.33 -0500, Charles Oliver N. ha
scritto:

Adam S. wrote:

Or you could:

jruby -e “include Java; puts
java.lang.System.getProperty(‘os.name’)”

The difference being that for the rbconfig version we try to
normalize
the names to what CRuby reports…

Thanks for the suggestions. There was a bug in the OS detection that
prevented to run ffi-opengl with jruby. Now it should be fixed as commit
645184 on github[1].

Andrea

[1] - http://github.com/remogatto/ffi-opengl/tree/master


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#5

Adam S. wrote:

Or you could:

jruby -e “include Java; puts java.lang.System.getProperty(‘os.name’)”

The difference being that for the rbconfig version we try to normalize
the names to what CRuby reports…

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email