Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > os.name

Reply
Thread Tools

os.name

 
 
anonymous@coolgroups.com
Guest
Posts: n/a
 
      05-14-2004
Could someone tell me the values of
System.getProperty( "os.name" )
for the various Windows architectures and Linux?
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      05-14-2004
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?

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      05-14-2004
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
 
Reply With Quote
 
Christophe Vanfleteren
Guest
Posts: n/a
 
      05-14-2004
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
 
Reply With Quote
 
Real Gagnon
Guest
Posts: n/a
 
      05-15-2004
wrote in
news: om:

> 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.

Bye.
--
Real Gagnon from Quebec, Canada
* Looking for Java or PB snippets ? Visit Real's How-to
* http://www.rgagnon.com/howto.html
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      05-15-2004
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
 
Reply With Quote
 
Liz
Guest
Posts: n/a
 
      05-15-2004

"Real Gagnon" <realgagnon_@_yahooSpamIsBadSstripunderscore.com > wrote in
message news:Xns94E9D5F137E9Erealhowtowwwrgagnonc@140.99.9 9.130...
> wrote in
> news: om:
>
> > 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)


 
Reply With Quote
 
Liz
Guest
Posts: n/a
 
      05-15-2004

"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.


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      05-15-2004
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
 
Reply With Quote
 
Liz
Guest
Posts: n/a
 
      05-15-2004

"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....bert/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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments