0

Is there any way to run a program (maybe C, C++, Java or Python) inside another Java program and get output.

I am developing a kind of Code-Editor and a kind of HackerRank clone with Java and I want the code editor to execute the program as well.

I have tried using

Runtime.getRuntime().exec("python Program.py")

in Java. But I do not find it that convincing. Is there any other way to achieve this??

  • did it work? If so, explain how you "do not find that convincing" – jhamon Jul 23 '20 at 15:40
  • Yes, I was able to get the Output of the program if the program was perfectly correct. But if there are any errors in the program, then I was not able to get the error messages. – Aravind Kumar Jul 23 '20 at 15:41

0 Answers0