I have an If statement and it seems that it is not functioning properly. The first part of the if statement is getting skipped over. I am checking to see if a ".lic" file exists and if it does then execute the command, otherwise give message that the file does not exist.
try{ String License = System.getProperty("user.dir") + ("*.lic"); File license = new File(License); if (license.exists()){ try{ Runtime.getRuntime().exec(cmd); } catch (IOException ex) { } } else { JOptionPane.showMessageDialog(null, "Need to activate license, please see README file"); } }catch(HeadlessException e){ // if any error occurs }