os.name

Discussion in 'Java' started by anonymous@coolgroups.com, May 14, 2004.

  1. Guest

    Could someone tell me the values of
    System.getProperty( "os.name" )
    for the various Windows architectures and Linux?
     
    , May 14, 2004
    #1
    1. Advertising

  2. Andrew Thompson, May 14, 2004
    #2
    1. Advertising

  3. Chris Smith Guest

    wrote:
    > Could someone tell me the values of
    > System.getProperty( "os.name" )
    > for the various Windows architectures and Linux?


    It's not specified.

    Practically speaking, you can count on the property to contain some
    case-variant of "windows" for a Windows system, and "linux" for a Linux
    system. However, I wouldn't count on more than that at all. For
    example, it wouldn't suprise me if Windows 2000 reports itself as NT, or
    some such thing.

    --
    www.designacourse.com
    The Easiest Way to Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
     
    Chris Smith, May 14, 2004
    #3
  4. Andrew Thompson wrote:

    > On Fri, 14 May 2004 15:10:59 GMT, wrote:
    >
    >> Could someone tell me the values of
    >> System.getProperty( "os.name" )
    >> for the various Windows architectures and Linux?

    >
    > Why does your app. need to know?


    Sometimes you need to, in order to integrate better with the host OS. Like
    when trying to open a webbrowser or filemanager for example.

    --
    Kind regards,
    Christophe Vanfleteren
     
    Christophe Vanfleteren, May 14, 2004
    #4
  5. Real Gagnon Guest

    Real Gagnon, May 15, 2004
    #5
  6. On Fri, 14 May 2004 18:40:12 GMT, Christophe Vanfleteren wrote:
    > Andrew Thompson wrote:
    >> On Fri, 14 May 2004 15:10:59 GMT, wrote:
    >>
    >>> Could someone tell me the values of
    >>> System.getProperty( "os.name" )
    >>> for the various Windows architectures and Linux?

    >>
    >> Why does your app. need to know?

    >
    > Sometimes you need to, in order to integrate better with the host OS. Like
    > when trying to open a webbrowser or filemanager for example.


    Like so?
    <http://www.physci.org/codes/display.jsp?fl=/edu/stanford/ejalbert/BrowserLauncher.java#468>

    Yes, I realised it _might_ be something like that.

    OTOH I asked in case it turns out to be..

    "I want to store some options in the users
    default directory and know that on XP it
    is located..."

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, May 15, 2004
    #6
  7. Liz Guest

    "Real Gagnon" <realgagnon_@_yahooSpamIsBadSstripunderscore.com> wrote in
    message news:Xns94E9D5F137E9Erealhowtowwwrgagnonc@140.99.99.130...
    > wrote in
    > news::
    >
    > > Could someone tell me the values of
    > > System.getProperty( "os.name" )
    > > for the various Windows architectures and Linux?

    >
    > Visit http://www.tolstoy.com/samizdat/sysprops.html
    > for a list of possible values.


    "Windows XP" for widows xp professional (is not in the list above)
     
    Liz, May 15, 2004
    #7
  8. Liz Guest

    "Andrew Thompson" <> wrote in message
    news:1oaq0h1w89428$...
    > On Fri, 14 May 2004 15:10:59 GMT, wrote:
    >
    > > Could someone tell me the values of
    > > System.getProperty( "os.name" )
    > > for the various Windows architectures and Linux?

    >
    > Why does your app. need to know?
    >

    I had one application that looked at this value so
    I could print out a message that the program was or
    was not tested on that OS.
     
    Liz, May 15, 2004
    #8
  9. On Sat, 15 May 2004 07:57:51 GMT, Liz wrote:
    > "Andrew Thompson" <> wrote in message
    >> On Fri, 14 May 2004 15:10:59 GMT, wrote:

    ...
    >>> System.getProperty( "os.name" )

    ...
    >> Why does your app. need to know?
    >>

    > I had one application that looked at this value so
    > I could print out a message that the program was or
    > was not tested on that OS.


    Good point. BrowserLauncher uses it as well..
    <http://www.physci.org/codes/display.jsp?fl=/edu/stanford/ejalbert/BrowserLauncher.java#202>

    There are certainly valid uses for it, but consider..

    <untested snippet>
    if (s.equals("Mac OS")) {
    eol = "\n";
    } else if.. {
    ...
    } else { // windows!!
    eol = "\n\r";
    }
    </untested snippet>

    ...as yet, we do not know why the
    OP needs the information, and most
    of the reasons for wanting it,
    are bad ones. ;-)

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, May 15, 2004
    #9
  10. Liz Guest

    "Andrew Thompson" <> wrote in message
    news:...
    > On Sat, 15 May 2004 07:57:51 GMT, Liz wrote:
    > > "Andrew Thompson" <> wrote in message
    > >> On Fri, 14 May 2004 15:10:59 GMT, wrote:

    > ..
    > >>> System.getProperty( "os.name" )

    > ..
    > >> Why does your app. need to know?
    > >>

    > > I had one application that looked at this value so
    > > I could print out a message that the program was or
    > > was not tested on that OS.

    >
    > Good point. BrowserLauncher uses it as well..
    >

    <http://www.physci.org/codes/display.jsp?fl=/edu/stanford/ejalbert/BrowserLa
    uncher.java#202>
    >
    > There are certainly valid uses for it, but consider..
    >
    > <untested snippet>
    > if (s.equals("Mac OS")) {
    > eol = "\n";
    > } else if.. {
    > ...
    > } else { // windows!!
    > eol = "\n\r";
    > }
    > </untested snippet>
    >
    > ..as yet, we do not know why the
    > OP needs the information, and most
    > of the reasons for wanting it,
    > are bad ones. ;-)
    >

    I just used it for CYA
     
    Liz, May 15, 2004
    #10
  11. On Sat, 15 May 2004 09:58:04 GMT, Liz wrote:

    >>> I had one application that looked at this value so
    >>> I could print out a message that the program was or
    >>> was not tested on that OS.

    ...
    >> There are certainly valid uses for it, but consider..

    ....
    > I just used it for CYA


    Always a good strategy. ;-)

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, May 15, 2004
    #11
  12. Andrew Thompson wrote:

    <snip>
    >> Sometimes you need to, in order to integrate better with the host OS.
    >> Like when trying to open a webbrowser or filemanager for example.

    >
    > Like so?
    >

    <http://www.physci.org/codes/display.jsp?fl=/edu/stanford/ejalbert/BrowserLauncher.java#468>
    >
    > Yes, I realised it _might_ be something like that.


    Yeah, sure, that's very easy to say afterwards :)

    --
    Kind regards,
    Christophe Vanfleteren
     
    Christophe Vanfleteren, May 15, 2004
    #12
  13. Andrew Thompson, May 15, 2004
    #13
  14. P.Hill Guest

    Liz wrote:
    >>Visit http://www.tolstoy.com/samizdat/sysprops.html
    >>for a list of possible values.

    >
    > "Windows XP" for widows xp professional (is not in the list above)


    I sent Chris at Samizdat Productions a run of his sample program on
    a Windows XP home edition. I assume we'll see the results on his site
    sometime soon.

    -Paul
     
    P.Hill, May 16, 2004
    #14
  15. gomotocross

    Joined:
    Nov 9, 2010
    Messages:
    1
    Location:
    Cleveland
    OS.NAME list

    Here is a simple list
    AIX
    Digital Unix
    FreeBSD
    HP UX
    Irix
    Linux
    Mac OS
    Mac OS X
    MPE/iX
    Netware 4.11
    OS/2
    Solaris
    Windows 2000
    Windows 7
    Windows 95
    Windows 98
    Windows NT
    Windows Vista
    Windows XP
     
    gomotocross, Nov 9, 2010
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?iso-8859-1?B?bW9vcJk=?=
    Replies:
    7
    Views:
    875
    Roedy Green
    Jan 2, 2006
  2. ding feng
    Replies:
    2
    Views:
    2,876
    ding feng
    Jun 25, 2003
  3. Bobby Chamness
    Replies:
    2
    Views:
    2,426
    Joe Smith
    Apr 22, 2007
  4. Jack-2
    Replies:
    3
    Views:
    308
    Jack-2
    Dec 24, 2003
  5. Java  script  Dude

    IE name="name" & form.name property bug

    Java script Dude, Jun 29, 2004, in forum: Javascript
    Replies:
    5
    Views:
    269
    Java script Dude
    Jun 30, 2004
Loading...

Share This Page