Search code examples
javajava-process-runtime

How to get errors in Python subprocess created by java


I start the python process by java Runtime.getRuntime().exec("python pythonCode.py") method,

I want to get to know about are there are any errors in python programm and what are those,can i do that?


Solution

  • Please try the following suggestion

    • Try to write some logs like success.log or failure.log in your python process and after Runtime is ran check if success or failure log is there.
    • If the process is failed parse the failure log to get the root cause.

    hope this will help your question