Solved

why would the output to the screen be different than output that is captured?

Posted on 2006-11-15
5
175 Views
Last Modified: 2012-05-05
i am using a 3rd party java app, so i dont know the internal workings of it.  i was trying to launch the app from a webservice powered by .NET, but for some reason, it doesnt work (although the app runs fine when launched manually).  one thing i noticed eventually, is that when you try to capture the out put (for instance using "> soemthing.txt" in DOS, the output that is captured is completely different than the output that the java app prints to the screen.  any ideas on how that could be possible?
0
Comment
Question by:trip008vk
  • 2
  • 2
5 Comments
 
LVL 92

Expert Comment

by:objects
ID: 17951244
is the java app displaying output from stdout?
0
 

Author Comment

by:trip008vk
ID: 17951285
i'm not sure.  in know nothing about the internal workings of it.  when i run it from the dos prompt, it prints out several lines to the command window.  when i redirect the output to a text file, it only writes one line (and this line is different form all the others!)
0
 
LVL 92

Expert Comment

by:objects
ID: 17951315
thats very strange, no idea why that would be happening.
0
 
LVL 6

Accepted Solution

by:
SamsonChung earned 125 total points
ID: 17956667
the output of the Java prog is sending to stderr.

what you want is the file redirected one.

not the one on your screen.

0
 
LVL 6

Expert Comment

by:SamsonChung
ID: 17956674
or, the author/designer of the program is smart enough to handle '> something.txt' in command line java.

try sending that to a linux system and see if the results are similar



0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now