How to get the system platform properties?

I want to handle something in a platform dependent way. For exampleif ( xxx == "windows" )do windows stuff hereif ( xxx == "linux")do linux stuff herecould anybody tell me how would i write the "if" lines?thank you.
[264 byte] By [erv2] at [2007-9-30 19:10:28]
# 1
System.getProperty("os.name") Note that teh returned String is more detailed than you want ("Windows 2000", etc...)Mike
bellyripper at 2007-7-6 23:21:40 > top of Java-index,Java Essentials,Java Programming...
# 2
Try the following:import java.util.*;...Properties p = System.getProperties();String osname = p.getProperty("os.name");
JohanR25 at 2007-7-6 23:21:40 > top of Java-index,Java Essentials,Java Programming...
# 3
[url http://java.sun.com/docs/books/tutorial/essential/system/properties.html] Systen properties in java. [/url]
kilyas at 2007-7-6 23:21:40 > top of Java-index,Java Essentials,Java Programming...