os.name

A

anonymous

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

Andrew Thompson

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?
 
C

Chris Smith

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
 
C

Christophe Vanfleteren

Andrew said:
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.
 
L

Liz

Andrew Thompson said:
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.
 
A

Andrew Thompson

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. ;-)
 
L

Liz

Andrew Thompson said:
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
 
P

P.Hill

Liz said:
"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
 
Joined
Nov 9, 2010
Messages
1
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top