I am developing a programm in java, using Eclipse IDE, and I'm trying to run a python script using a java method. This python script will simply write "Test2" in a txt file, so it really won't interfere with anything within my java programm.
The image bellow shows how my packages are organized:
The python script I wish to run is Communication.py, and I used the following method, (called by Systemm.java on the method main
) to do so:
private void runServer() {
try {
System.out.println("Im running your py");
Process p = Runtime.getRuntime().exec("cmd /c python pythonClient\\Communication.py");
} catch (IOException e) {e.printStackTrace();}
}
However this method does literally nothing (apart from printing "Im running your py").
I have never really worked with java Runtime's class, and I just copied this command from the internet, so I'd really aprecciate any help, in solving this issue.
P.S: my other classes both py and java are all working smoothly. This is literally the only issue so far