I am running a python script located in my Eclipse project folder with the following Java code:
Process p = Runtime.getRuntime().exec("python pythonscript.pyw");
p.waitFor();
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
System.out.println(in.readLine());
My console always reads null and my p.exitValue() is 2. However, typing the following in Windows command prompt works just fine and I get the correct output:
C:\users\user\workspace\project>python pythonscript.pyw
Does this have something to do with specifying my directory in Eclipse?