Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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

Win a copy of The Software Craftsman this week in the Agile forum!
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: 14667

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: 19958

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

How To Ask Questions How To Answer Questions
Have you tried LearnNowOnline?
subject: Problem in eclipse IDE Galileo