I have two different python executable programs that reference either a picture or a .txt
file from within their applications. When I open them as is they work perfectly. I have a master program that I use in Java to open the applications by clicking a button that executes:
final String filePath = appList.get(1).get(3);//a string of the file directory
try {
Runtime.getRuntime().exec(filePath);
} catch (IOException e) {
System.err.println("Caught IOException: " + e.getMessage());
}
When I launch the programs from this master program, it can no longer locate these files even though the directory remains the same. The only thing that seems to change is that I am launching the applications from a java program instead of just clicking on the application itself. Anyone know what to do?
EDIT: I am trying:
String fileDir = appList.get(2).get(3).substring(0,appList.get(2).get(3).lastIndexOf("\\"))+"\\";
Process p = null;
ProcessBuilder pb = new ProcessBuilder(lastWord);
pb.directory(new File(fileDir));
p = pb.start();
But the system cannot find the file specified
.