I am trying to open a url by clicking over the link of JLabel in Windows 7 (32 -bit) but unable to do so. After clicking on the link, it doesn't do anything. Although, it is opening the file successfully.It used to work in XP.

The code is as follows:

String osname = System.getProperties().getProperty("os.name").toUpperCase();                
if (osname.startsWith("WINDOWS")){
    Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL \"" + path + "\"");                    
    String[] commands = {"start", "\"\"", path};    

I would appreciate your help.

        String[] cmd = new String[5];
        cmd[0] = "cmd.exe";
        cmd[1] = "/C";
        cmd[2] = "start";
        cmd[3] = "\"\"";
        cmd[4] = path;

        try {
        catch (IOException e) {

The above code worked. Thanks anyway!