posted 19 years ago
Hi,
Welcome to JavaRanch!
In general, you don't compile Java code for one particular platform; that's the whole point. You might be compiling on a Mac, but that same code might be used on Windows or Linux. Java has binary portability.
Now, sometimes, occasionally, you need to do something different at runtime on the different platforms. In this case, you can detect the platform in your code at runtime based on the value returned from System.getProperty("os.name"), and decide what to do.