0

I have these interdependent .java files. One of them contains the main statement that starts running a program and calling on all these other files. The results are some output files in .txt format. Until now, I ran the main statement in IntelliJ and then opened a jupyter notebook where I loaded the resulting .txt file after the process was finished. I want to write a python script in jupyter notebook that tells the machine to run the main statement from this .java file in this path and then do something with the resulting .txt output files on its own.

I am new to programming, and I have a hard time understanding what this process is called. I have been googling for the past two days and mostly found examples of how to run java code in python or vice versa, e.g. with jython or py4j. From what I understand, this is not what I need, because I don't need all the java scripts to run within python, I just need python to kickstart the process and then wait for the output to be produced.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
ratsrule23
  • 33
  • 4
  • 1
    If you wanted to run the Java program at the command line, what command would you type in? Figure that out, and then see the linked duplicate. – Karl Knechtel Feb 08 '23 at 16:19
  • "I have been googling for the past two days and mostly found examples of how to run java code in python or vice versa, e.g. with jython or py4j." Really? Because when I try [copying and pasting your question title into a search engine (not even Google)](https://duckduckgo.com/?q=How+do+I+run+a+python+script+that+runs+a+java+program%3F), I see relevant results that are exactly what you want right off the top. – Karl Knechtel Feb 08 '23 at 16:22
  • @KarlKnechtel thats weird. The search results from Duckduckgo are indeed helpful. However, if you type in the same question in Google, at least for me, the search results are about how to run python scripts from java, or the jython/py4j things I mentioned. – ratsrule23 Feb 08 '23 at 16:48

0 Answers0