I have trouble with the following situation:
I want to run a process using ProcessBuilder in Java. The code as it is used to work on other computers and is very basic. But now, if I run the program in Eclipse, the executable called, gives me an error with only information being the Path variable. But nevertheless, if I export the project as a jar file, the program works fine! I already checked all path variables with the computer where it works, and all are included in the processbuilder while running in eclipse (I checked ProcessBuilder.environment()) , but for some strange reason this just won't work.
As I said, the code is really basic and works if it was exported as a jar:
String [] cmdArr = cmd.split("\\s+");
ProcessBuilder pb = new ProcessBuilder(cmdArr);
Process p;
p = pb.start();
p.waitFor();
Also if I call the project from another project, the result is the same behaviour: not working, until exported as a jar.
Again: all Path variables are appended.
I would be very grateful, if someone could give a hint into the right direction.
My computer is running Windows 7 x64, Eclipse Kepler Service Release 1, JDK 1.8.0_05 x64
I could not find anything by searching for similar problems, since including "path" in the search yields many popular problems about java not working or setting path variables for runs and on the other hand "Running as a jar but not in Eclipse" (and similar searches) only provide the contrary, namely something running in Eclipse, stops working as an exported jar. But those are all rather easy problems, and unfortunately don't help me.
Thanks in advance
Dan