Pipe console output to application

Hello all
Does anyone know of a quick and simple way of piping the console output to, say, a JTextArea in my application? I have imported a 3rd-party library into my app which, when DEBUG=true, outputs to the console via (I suppose) System.out.println(). I want to intercept that stream and output that directly in my app.
Ideas?
Thanks in advance
HK

You can use System.setOut (and System.setErr or System.setIn) to choose different default standard input/output/error streams.
So assuming this app is using System.out, you could just remap that to something that prints to a JTextArea.

Similar Messages

  • I want to show console output in my cmd prompt in C# winform application

    Hi,
    I'm launching the some process in C# .net Winform appliaction. But i couldn't able to see console output on the screen. The process is getting launched but inside cmd prompt window, it is showing nothing. I would like to show something on cmd prompt. Please
    help on this.
     using (Process comxdcProcess = new System.Diagnostics.Process())
                            comxdcProcess.StartInfo.FileName = fileName;
                            comxdcProcess.StartInfo.Arguments = args;
                            comxdcProcess.StartInfo.RedirectStandardError = true;
                            comxdcProcess.StartInfo.RedirectStandardOutput = true;
                            comxdcProcess.StartInfo.UseShellExecute = false;
                            comxdcProcess.Start();
                            this.errorComment = comxdcProcess.StandardError.ReadToEnd();
                            StreamReader myStreamReader = comxdcProcess.StandardOutput;
                            //// Read the standard output of the spawned process. 
                            this.errorComment = myStreamReader.ReadToEnd();
                            comxdcProcess.WaitForExit();
    click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you Happy Programming! Hari

    @Hariprasadbrk
    Do you mean you have use process class to start "cmd prompt" And want to display some output in it?
    If so, there is no need to use RedirectStandardOutput property. This property means the output of an application is written to the
    Process.StandardOutput stream.
    // Setup the process with the ProcessStartInfo class.
    ProcessStartInfo start = new ProcessStartInfo();
    start.FileName = @"C:\7za.exe"; // Specify exe name not cmd exe.
    start.UseShellExecute = false;
    start.RedirectStandardOutput = true;
    // Start the process.
    using (Process process = Process.Start(start))
    // Read in all the text from the process with the StreamReader.
    using (StreamReader reader = process.StandardOutput)
    string result = reader.ReadToEnd();
    Console.Write(result);
    Output
    This section shows the output of the process.
    7-Zip (A) 4.60 beta Copyright (c) 1999-2008 Igor Pavlov 2008-08-19
    Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
    [<@listfiles...>]
    So you can start a cmd exe.
    Please also take a look at the article from codeproject
    How to redirect Standard Input/Output of an application
    In summary, the shutdown proces is invoked from my application, and it displays the output from the process in RichTextBox control.
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can i display console outputs in my form?

    Hi,
    <p>I have an application which performs some actions like, insert 200 rows in the database. While inserting data i am using <code>
    int i=0;
    system.out.println ("Insert "+i+" row in database");
    i=i+1;
    </code>
    The output displays on the commnad line.</p>
    <p>what i am trying to do is i have a form, which has text area. I want to display the console output "Insert 1 row in database" and next "Insert 2 row in database"..... and soon in the text area. How could i do that?</p>
    <p>Thanks in advance!!</p>

    Hi Petes,
    Thanks for you response. I am very new to java. I just started learning jsp and have bit knowledge of swing. I am confused how to use jsp and swing componenets together. Can you please guide me a bit?
    Also i am using AJAX to update form field. I am able to work with the rest except bringing the console output in the text area.
    Do you think i have some other way to do it?
    Do you think, it is a good idea , if I will save the output strings in a file and with the help of jsp i can read the file in textarea.
    Pin2g

  • How can i display console outputs in my form field?

    Hi,
    I have an application which performs some actions like, insert 200 rows in the database. While inserting data i am using
    int i=0;
    system.out.println ("Insert "+i+" row in database");
    i=i+1;
    The output displays on the commnad line
    what i am trying to do is i have a form, which has text area. I want to display the console output "Insert 1 row in database" and next "Insert 2 row in database"..... and soon in the text area. How could i do that?
    Thanks in advance!!
    pin2g

    solution removed, because you crossposted.
    Message was edited by:
    Navy_Coder

  • Server console output

    Hi,
    I have been using flex from last six month. I have develped one application and now its time to deploy the application. But, I am facing one issue regarding server console output. In my application I have various remote call to java class deployed on JBOSS server. My problem is that, whenever I made any remote call the information of that remote call gets printed on server console. I want to stop this server console printing. How can I do this? Please suggest. I have checked in my code, there is no trace() or system.out.println() command is used. Please help me out of this. Its very urgent.
    Thanks.
    Regards,
    Ravindar Kumar

    Hi
    You can setup properties so that we can save stdout and stderr to files.
    In the setDomainEnv.cmd file of your domain, you can set the properties so that the ouput will be saved to a file
    %WLS_STDOUT_LOG%
    %WLS_STDERR_LOG%
    Vimala-

  • How to see console output in Sun Java(TM) System Web Server 6.1 SP7?

    Dear All,
    I am having Sun Java(TM) System Web Server 6.1 SP7 installed on Windows 2000 Prof.
    I have deployed few applications and they were running successfully.
    From debugging point of view, i like to see the output from System.out.println .
    Prior to SP7 there is a console which shows this output. But now the batch files only starts and stops the admin and site server services. Where to see for console output?
    Is there command like tail.exe of Weblogic awailable for Sun Java System Web Server or any setting to be done in Admin?
    Please revert.
    -Sameer

    Response headers can be found in srvhdrs pblock.
    Those can be manipulated by using set-variable
    http://docs.sun.com/app/docs/doc/820-1638/6nda01tea?l=en&a=view#abuis
    You can read more about these in
    Sun Java System Web Server 6.1 SP8 Administrator's Configuration File Reference
    http://docs.sun.com/app/docs/doc/820-1638?l=en
    and
    Sun Java System Web Server 6.1 SP8 NSAPI Programmer's Guide
    http://docs.sun.com/app/docs/doc/820-1643?l=en

  • How to set echo of console output  as ' * ' ?

    I've made a bank application in java using console input/output and when the password is typed,it echo the same word as typed.
    So how can i change the echo of console output specially when asking for password ?

    Thankue very much.
    But do me a favour i've jdk 1.5 installed in my system.
    I don't have java.io.Console class file, so will you please send me only that class file or give me link from where i can get that.
    My email address is -
    [email protected]

  • Console output - way too much info...

    when i debug my application i get loads of the following statements in the console output..
    [SWF] /blah/blah/blah.swf/[[DYNAMIC]]/1 - 172 bytes after decompression
    [SWF] /blah/blah/blah.swf/[[DYNAMIC]]/1 - 121 bytes after decompression
    [SWF] /blah/blah/blah.swf/[[DYNAMIC]]/1 - 172 bytes after decompression
    [SWF] /blah/blah/blah.swf/[[DYNAMIC]]/1 - 121 bytes after decompression
    I am using the flash builder beta 2 plug in with Zend Studio 7 and I have got swfs embedded in mx:image tags.
    Maybe it is an issue with Zend Studio and what it displays in the console...  Maybe it is a setting I don't know about in Flash Builder or it could be the embedded swfs... but if anyone can help i would really appreciate it..
    at the moment there are so many messages it is hard for me to locate my trace statements. blessings..

    still looking for an answer if anyone can help..?

  • Jarred swing app and getting console output

    Hi,
    I've created a jar app using eclipse that starts a swing application. The jar works fine, but I was curious if there was a way to double-click the file and get console output as well. When I start the program through the command line, I can get my output, but double-clicking the icon doesnt' start up a console. Is there a way to accomplish this?
    Thanks

    Normally in Windows systems the javaw executable is assigned to the jar extension. javaw is a jvm without console. You might want to change that and assign java to jar but be aware, that this affects all jar files.
    If you want to do that just for that jat file I would write a bat file which starts the application using java.

  • Output to application server.

    Hello All,
    I have ouput in HIERARCHIAL LIST. Im displaying Header table G_T_VBAK and Item table G_T_VBAP.
    I want to save this output in application server. Can any one help?
    My code is as follows.
      OPEN DATASET g_f_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
        MESSAGE e899(mm) WITH 'not possible' space space space.
        EXIT.
      ELSE.
        LOOP AT g_t_vbak.
          TRANSFER g_t_vbak TO g_f_file.
          LOOP AT g_t_vbap.
            TRANSFER g_t_vbap TO g_f_file.
          ENDLOOP.
        ENDLOOP.
      ENDIF.
    It is giving dump at the line TRANSFER g_t_vbap TO g_f_file. (second loop statement).
    Good answers will be appriciated with points.
    Thanks in advance.
    Best Regards,
    Sasidhar Reddy Matli.

    Hello Kris,
    The dump message is as follows:
    What happened?
    Error in ABAP application program.
    The current ABAP program "ZSSR_ORDER_DETAILS_HIER1" had to be terminated
    because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    Error analysis
    Only character-type data objects are supported at the argument
    position "f" for the statement
      "TRANSFER f TO ...".
    In this case, the operand "f" has the non-character-type "u". The
    current program is flagged as a Unicode program. In the Unicode context,
    type X fields are seen as non-character-type, as are structures that
    contain non-character-type components.
    Source code extract
    002370   FORM download_to_application_server .
    002380
    002390     OPEN DATASET g_f_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    002400
    002410     IF sy-subrc NE 0.
    002420
    002430       MESSAGE e899(mm) WITH 'not possible' space space space.
    002440       EXIT.
    002450
    002460     ELSE.
    002470
    002480       LOOP AT g_t_vbak.
    002490
    002500         TRANSFER g_t_vbak TO g_f_file.
    002510
    002520         LOOP AT g_t_vbap.
         >           TRANSFER g_t_vbap TO g_f_file.
    002540         ENDLOOP.
    002550
    002560       ENDLOOP.
    002570
    002580     ENDIF.
    002590
    002600   ENDFORM.                    " download_to_application_server
    Best Regards,
    Sasidhar Reddy Matli.

  • How to print console output

    Hi, I have a JSP page and I would like to print STDOUT to the page. Is this possible?
    I've seen a few methods and none work for me:
    BufferedReader reader = new BufferedReader(System.out);
    String input = reader.readLine();
    out.println(input);*** Error: Type BufferedReader was not found.
    FileOutputStream out;
                    PrintStream ps; // declare a print stream object
                    try {
                     // Create a new file output stream
                    out = new FileOutputStream("myfile.txt");
                            // Connect print stream to the output stream
                            ps = new PrintStream(out);
                            ps.println ("This data is written to a file:");
                System.err.println ("Write successfully");
                            ps.close();
                    catch (Exception e){
                            System.err.println ("Error in writing to file");
                    }*** Error: Duplicate declaration of local variable "out".
    *** Error: The type of the left-hand side in this assignment, "javax/servlet/jsp/JspWriter", is not compatible with the type of the right-hand side expression, "java/io/FileOutputStream".
    *** Error: No match was found for constructor "PrintStream(javax.servlet.jsp.JspWriter)".
    So what's next?
    How can I call the console without writing to a file first?
    I would like AJAX to show console output in real-time.

    Thanks for your help.
    The reason I have the script to write to a file is because it's the closest I could find to what I want. Ideally, I would be able to run a script that prints to the console but I want to grab the system.out going to the console and display it on the page.
    Basically, I want the page to act as a console but not redirect the output (I want it to still go to the console) and I don't want it in a text file that the page reads.
    So for example, the page loads and while that is occurring, the server grabs the console output and prints to the page. Then I run a function on the page that prints to the console and on the refresh, print the updated output. Ideally, I would restrict the output that was relevant to the page's functions and ignore every output to the console but I'm not (trying to be) picky.
    So how would that work?
    Pseudo-code:
    for (int i=0;i < System.out().length(); i++) {
            String grabbedtext += System.out().toString();
    }out.println(grabbedtext);

  • Create console output from LabView

    Hi all.
    Is there any way of creating a console string output when calling a dll from LabView?
    I have to call a C++ program from LabView and I'm using a dll. I need to debug this program, and I think that using "cout" is the fastest and simplest way.
    Thanks in advance.
    Regards,
    Francisco

    No, there is no console output when calling a DLL. You could have your DLL simply write debug information to a log file.

  • Flash CS6 does not not create an .app file when I Output as application with runtime embedded

    I am attempting to create an application with runtime embedded, but the process keeps failing without throwing an error. Specifically: in Air Settings, I select Output as: Application with runtime embedded. When I build it this way, Flash tells me that it's created Telepath Tactics - Steam.app...
    ...but no .app file ever actually appears in the folder:
    This happens regardless of what I include in the Library Path, and regardless of the Default Linkage settings. (When I tell it to Output as: Windows installer, by contrast, the appropriate exe file appears without a problem.)
    I'm using Flash Professional CS6 v. 12.0.0.481 on Windows 7, 64-bit.

    I should note that this only occurs on certain windows machines. I am still waiting to hear which ones.
    I personally do not experience this so I have to rely on Client feedback.
    On my machine it works fine without Flash installed.

  • Change console output device?

    Hi all,
    I have a laptop that I sometimes connect to a larger monitor.  I would like to be able to change my console output device so that I can connect to my larger monitor on the fly and have my console output switch over-- basically I'm looking for xrandr for the console (xrandr does the job just fine in X11).
    If I initially boot up with my laptop screen closed and my monitor connected, the console output goes to my monitor as desired.  But I would like to be able to switch output devices on the fly, rather than having to reboot to switch console output between my monitor and laptop screen.  Thanks for any help

    just found your post...
    I ask the same here http://bbs.archlinux.org/viewtopic.php?id=68589 without an answer yet, maybe you want to suscribe to mine as i do here in yours

  • Slow console output in new JDEVELOPER

    Hi,
    I have really trivial problem with new versions of JDEVELOPER (e.g. 9.0.3.1035 or
    9.0.3.1 built 1107) - slow console output.
    This OutputTest.java runs approx. 30 seconds !!
    There is no such a problem with e.g. JDEVELOPER 9.0.3.988 Preview. It takes only 0.2 second.
    Is there any workaround ? Can you help me to solve the problem?
    Thanks,
    Fero
    public class OutputTest {
    public static void main(String[] args) {
    for (int i = 0; i &lt; 1000; i++) {
    System.out.println("Very slow output" + i);

    This issue has been fixed for a later release. I don't know of any work around for you, except not writing so much to System.out and System.err.
    -Liz

Maybe you are looking for

  • HP LaserJet Pro MFP M225dw SMTP serwer error

    Hello I have problem with scannig to email from me new HP LaserJet Pro MFP M225dw, i configured everything and it worked i scanned and meiled a test scan. After 2-3 h i tryed to scan a new document and got error that me SMTP servers don't respond. I

  • Can't download a purchase from Mac App Store

    I recently bought OSX Lion and redeemed it through the Mac App Store. When I go to my purchases, I see it there and I click the download button, but it doesn't download. The little spinning gear shows up for a few seconds in the top left corner and t

  • Metafile download failed - Flash 11.6.602.180

    I have x2 systems that I am trying to install this onto since yesterday morning both with IE9: Windows 7 Enterprise x86 SP1 Windows 7 64-bit I select that I do not want Chrome or automatic updates and it just will not install. I noticed that if I sel

  • My iPhone occasionally starts with the message no sim card, how do I get it recognize the sim?

    My iPhone occasionally starts with the message no sim card, how do I get it recognize the sim?

  • Internet browser and form data

    Hi there I have a problem with forms displayed and submitted by the internet browser. We have a input field in which we need to write "Québec" and the "é" shows as "?". We also have a dropdown that displays the accentuated items correctly but the acc