public static final void launchBrowser(String url) throws Exception {
        String os = System.getProperty("os.name");
        Runtime runtime = Runtime.getRuntime();

        // Block for Windows Platform
        if (os.startsWith("Windows")) {
            String cmd = "rundll32 url.dll,FileProtocolHandler " + url;

            if (new File(url).exists()) cmd = "cmd /c start \"\" \"" + url + "\"";
            runtime.exec(cmd);
        }
        // Block for Mac OS
        else if (os.startsWith("Mac OS")) {
            Class<?> fileMgr = Class.forName("com.apple.eio.FileManager");
            Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] { String.class });

            if (new File(url).exists()) {
                // local file
                url = "file://" + url;
            }
            openURL.invoke(null, new Object[] { url });
        }
        // Block for UNIX Platform
        else {
            String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
            String browser = null;
            for (int count = 0; count < browsers.length && browser == null; count++)
                if (runtime.exec(new String[] { "which", browsers[count] }).waitFor() == 0) browser = browsers[count];
            if (browser == null)
                throw new Exception("Could not find web browser");
            else
                runtime.exec(new String[] { browser, url });
        }
    } /* public static final void launchBrowser(String url) */