How to create a process on node from a JVM which is running other node

82 views Asked by At

I have got an usecase where I have to call python script from Java program. Java process (JVM) will have to launch a process on other system/node (not within the same node). How this can be achieved?

1

There are 1 answers

0
Himanshu Bhardwaj On BEST ANSWER

If it is the same machine (jvm and python script), you can leverage ProcessBuilder class itself to execute script directly.

In case of script residing on another box, you can leverage JSch library which provides you ssh capabilities to launch process on remote machine.