Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    6
    Rep Power
    0

    Default cannot see the output...

    Hello!

    I just joined this forum it is a great website! Very very helpful for beginners like me...

    There is a problem which I can't resolve ... Please help!
    I am executing another program (written in Perl) from my Java application.
    It works great but the problem is that I cannot see the output of that
    Perl program in the command prompt window...

    This is a fragment of code:

    // Run locator.pl
    dosstring = "perl v:\\perl\\locators\\locator.pl " + fffpath + "\\" + ff0name + " " + fffpath + "\\" + fffname +" > output.txt";
    try {
    Process p1 = Runtime.getRuntime().exec(dosstring);
    }
    catch(IOException e1) {}

    Am I doing something wrong ? :confused:

    thank you !!!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    It looks to me as if the output of the perl program is a file called output.txt. Have you found such a file and does it contain what you expect?

  3. #3
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    6
    Rep Power
    0

    Default

    thank you Fubarable for your reply!
    I couldn't find anywhere the file output.txt.
    In the source code of Perl program I found that the standard output is STDOUT and when I run this perl program manually from the cmd, it displays the output on the screen...
    Any ideas ?
    thank you

  4. #4
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    6
    Rep Power
    0

    Default

    Hi Everyone!
    I found a way around my problem so that maybe this will be useful...
    Process p1 = Runtime.getRuntime().exec(dosstring);
    p1.waitFor();
    if(p1.exitValue()
    I analyze the exitValue of the perl script and it works!
    In case the result is negative I can manually check the log file
    created by the perl program.

    thank you !
    Mihail

Similar Threads

  1. Java, output string, getting correct output? HELP!
    By computerboyo in forum New To Java
    Replies: 2
    Last Post: 02-25-2009, 11:44 PM
  2. Output
    By Twiggy in forum New To Java
    Replies: 14
    Last Post: 12-31-2008, 10:03 AM
  3. What will be output and why
    By huma in forum Threads and Synchronization
    Replies: 4
    Last Post: 06-26-2008, 10:14 PM
  4. Why the output is always zero
    By mehrotra.chitij in forum New To Java
    Replies: 12
    Last Post: 04-25-2008, 04:05 AM
  5. output
    By Camden in forum New To Java
    Replies: 3
    Last Post: 12-01-2007, 10:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •