jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Problem in eclipse IDE Galileo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in eclipse IDE Galileo" Watch "Problem in eclipse IDE Galileo" New topic

Problem in eclipse IDE Galileo

kumarjit banerjee
Ranch Hand

Joined: Mar 27, 2011
Posts: 32


I am facing a problem in eclipse IDE.

In the above code, The exception is printed at different locations when run successively. The ideal output, which I got from running in command prompt, should be

But when run successively I got the output as above and also different output such as

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

That is because e.printStackTrace(); prints to a different output stream: System.err instead of System.out.

The System.out and System.err streams by default do both write their output to the console, but they are not synchronized with regard to each other. Therefore, the order of messages as they appear on the console via those two streams is not predictable.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Rob Spoor

Joined: Oct 27, 2005
Posts: 20276

Eclipse is notorious for mixing System.out and System.err in unpredictable ways.

How To Ask Questions How To Answer Questions
I agree. Here's the link: http://aspose.com/file-tools
subject: Problem in eclipse IDE Galileo
It's not a secret anymore!