title: Redirecting stdout of a jar file in java
body: <p>The scenario is as follows - I have a main java file <code>file1</code> and a <code>jar</code> file called <code>Minimize</code>. I create an <code>object</code> of a <code>class</code> called <code>MinimizeTable</code> which is defined in the <code>jar</code>. 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 - </p>
  
  <pre><code>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. 
     }
    }
  </code></pre>
  
  <p>Is there any way of doing this without touching the jar file? Hope my explanation makes sense. </p>