private void searchJars(File folder) { File[] files = folder.listFiles(); String version = null; try { version = Install.getVersion(); } catch (IOException e) { version = ""; } for (File f : files) { String s = f.getName(); if (s.startsWith("matconsolectl")) { if (jarMCTL != null) { // if there are more than one files matching this, only one allowed jarMCTL = null; break; } jarMCTL = f; } if (s.startsWith("MEP_" + version)) { if (jarMEP != null) { // if there are more than one files matching this, only one allowed jarMEP = null; break; } jarMEP = f; } } checkJARPath(); }