• Post Reply Bookmark Topic Watch Topic
  • New Topic

System.getProperty("os.name")  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing an application that uses Native Libraries. I am using os.name system property to determine which OS I am on so I know which Native Libs to load.
Does anyone know where I can get or have a link to or have a list of all the different os.name values that can be returned from the following Systems...
Windows 98
Windows 2000
Windows ME
Windows XP - I know this one is Windows XP
Linux
Solaris/sparc
MacOSX
Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this list. Can I assume this is accurate?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I recall correctly, the JVM spec provides no guarantee of the value returned by inspecting the os.name property. It also provides no other mechanism to determine for certain which operating system the JVM is running on.
So, for Windows 95, Sun's 1.3 JVM might return "Windows 95", while Sun's 1.4 JVM might return "Windows", while IBM's JVM might return "Windows 9x" or "Win95" or anything they want.
I think the best you can do is try to be as comprehensive as you want, by learning what values get returned by which JVM on which OS (and there are a lot of combinations to consider), and when in doubt, just ask the user.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!