Hi,
The problem is as follows, I am writing an analysis software, and as a final step of the analysis I want to give the users to view the analysis done. I have found a nice open source software for that last part and what I'd like to do is to execute that program from within my code so that the user doesn't need to bother with that..
The code as it is today looks like this:
note that i use system.err for debug since system.out points to a file (the packages i use in my code create a lot of clutter so I set the out stream to a file to keep the terminal relatively clean)
So what happens is that my code executes without any Exceptions thrown, but the application I want to run is never launched. If I c/p the debug text from system.err to terminal, everything works fine.. What could this depend on, and how would one go about solving it?
Thanks,
The problem is as follows, I am writing an analysis software, and as a final step of the analysis I want to give the users to view the analysis done. I have found a nice open source software for that last part and what I'd like to do is to execute that program from within my code so that the user doesn't need to bother with that..
The code as it is today looks like this:
Code:
try {
String path_2_owlfile = owlFile.getCanonicalPath();
if (path_2_owlfile.contains("owl")){
command.add("/usr/bin/java");
command.add("-jar");
command.add(path_to_program);
command.add(path_2_owlfile);
Object[] o = command.toArray();
String[] cmd = Arrays.copyOf(o, o.length, String[].class);
// debug info
StringBuilder sb = new StringBuilder();
for (int i=0;i<cmd.length;i++){
sb.append(cmd[i]);
sb.append(" ");
}
System.err.println(sb.toString());
Process child = Runtime.getRuntime().exec(cmd);
note that i use system.err for debug since system.out points to a file (the packages i use in my code create a lot of clutter so I set the out stream to a file to keep the terminal relatively clean)
So what happens is that my code executes without any Exceptions thrown, but the application I want to run is never launched. If I c/p the debug text from system.err to terminal, everything works fine.. What could this depend on, and how would one go about solving it?
Thanks,