我在这里有一个有趣的要求,我有一个已经存在的 java 程序,我必须用 java 编写一个自动化程序。我必须将两个程序的合并输出显示为报告。
输出应该有点像这样:
Output from program1 after executing line1
Output from myAutomation after executing line1
Output from program1 after executing line2
Output from myAutomation after executing line2
Output from program1 after executing line2
Output from myAutomation after executing line2
我怎样才能在java中实现这一点?AFAIK,每个java程序在JVM中单独运行并且是隔离的,那么这种东西可能吗?