This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
You can use System.getPropereties("os.name") to get the operating system's name. But the better way to do what you are trying to do is to use the static separator or separatorChar variables of the File class to determine what separator the OS uses. You can then construct a path:
Look at the API Docs for the File class for more information.
[edit note: My API link previously was linking to the J2EE API docs rather then the J2SE docs; sorry for any confusion] [ February 19, 2005: Message edited by: Mark Vedder ]
If you need to concat directory names, you can also use the appropriate File constructor, so that you don't have to care about the seperator at all.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus