The scenario is as follows - I have a main java file file1
and a jar
file called Minimize
. I create an object
of a class
called MinimizeTable
which is defined in the jar
. Now, this creation of object causes some lines to be printed to stdout which was defined in the jar. I want to redirect only this output. Apart from this, my main file has many stdout lines which must be printed to stdout itself. Is there anyway of redirecting only what is being printed by the jar file but not the rest?
I have defined the situation below -
class file1{
public static void main(String[] args)
{
MinimizedTable M = new MinimizedTable(); //this instantly prints stuff out which I want to be redirected and not printed to stdout.
System.out.println("Hello"); //This line must be printed to stdout.
}
}
Is there any way of doing this without touching the jar file? Hope my explanation makes sense.