public class HelloWindows { /** @dll.import("winmm", auto) */ static native boolean sndPlaySound(String lpszSound, int fuSound); public static void main (String args[]) { boolean returnCode; int flags = 0; String soundFile = System.getProperty("com.ms.windir") + "\\MEDIA\\The Microsoft Sound.wav"; System.out.println("Playing '" + soundFile + "'..."); returnCode = sndPlaySound(soundFile,flags); } }