Re-direct JavaP output

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re-direct JavaP output

J.Pena
Although this is not a strictly NetRexx issue, it will be used in a
NetRexx project. :)  I have written the following program to test how to
use 'javap' from within NetRexx (as opposed to running javap.exe):

  s=String[1]; s[0]=String 'java.awt.Button'
  sun.tools.javap.JavaP.main(s)

..and as a result you get the output shown on screen. However, I have
not been able to find out how to direct the output to a file.
Running javap.exe on 'sun.tools.javap.JavaP reveals that the constructor
for JavaP requires an object of type PrintWriter and so I have tried
modifying the above program as follows:

  s=String[1]; s[0]=String 'java.awt.Button'
  pw=PrintWriter(FileOutputStream('jptest'))
  jp=sun.tools.javap.JavaP(pw)
  jp.main(s)

..but the resulting file 'jptest', seems to always be empty, that is,
its size is zero and the output still shows on screen. In JIAN, the
description for JavaP doesn't shed any light on the matter.

---------------
cjpena
[hidden email]
---------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: Re-direct JavaP output

dIon Gillard/Multitask Consulting/AU
Have you tried redirecting System.out by using System.setOut ???

On Wed, 11 Mar 1998 15:40:42 EST, C.Joseph Pena wrote:

|   Although this is not a strictly NetRexx issue, it will be used in a
|   NetRexx project. :)  I have written the following program to test how to
|   use 'javap' from within NetRexx (as opposed to running javap.exe):
|  
|     s=String[1]; s[0]=String 'java.awt.Button'
|     sun.tools.javap.JavaP.main(s)
|  
|   ..and as a result you get the output shown on screen. However, I have
|   not been able to find out how to direct the output to a file.
|   Running javap.exe on 'sun.tools.javap.JavaP reveals that the constructor
|   for JavaP requires an object of type PrintWriter and so I have tried
|   modifying the above program as follows:
|  
|     s=String[1]; s[0]=String 'java.awt.Button'
|     pw=PrintWriter(FileOutputStream('jptest'))
|     jp=sun.tools.javap.JavaP(pw)
|     jp.main(s)
|  
|   ..but the resulting file 'jptest', seems to always be empty, that is,
|   its size is zero and the output still shows on screen. In JIAN, the
|   description for JavaP doesn't shed any light on the matter.
|  
|   ---------------
|   cjpena
|   [hidden email]
|   ---------------
|  
|   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|   To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
|   [hidden email]
|   with the following message in the body of the note
|   unsubscribe ibm-netrexx <e-mail address>
|  



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>