Eclipse Java System.out.println & Leading Spaces

LarryAndro used Ask the Experts™
I am using the Eclipse IDE.  In a Java class, when I print...

   System.out.println("                               IMPORTANT!!");

the leading spaces in the output to the console are stripped.  (This does not happen when a Java class' System.out.println output is executed from the command prompt.)

There must be a setting or parameter that controls how leading spaces are handled.  Can anyone help me?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
That's strange.  I just ran your one line of code in Eclipse 3.2.1 and I got the output you would expect:
"                               IMPORTANT!!"

There certainly are methods to strip leading and trailing blanks, but they have to be explicitly called.

Is this going to your regular console or somewhere else?



My output is going to the "regular console."  Knowing you are using Eclipse, and that the spaces are not stripped, is useful information.  It doesn't answer my question, but lets me know that the problem is likely local to my machine.  

I will wait for input from others.  Then, I'll give you the points, or split points.  And, thanks for taking time to run my line of code!
Really frustrating...For yucks, at home I created a Java project and one class with one LOC in the main() method - your line.  Same result. This was Eclipse 3.2.2.

So...sorry I can't seem to replicate your problem.  I'd suggest you install Eclipse, create a Java project, create a runnable class, and add your line.

Did you install the JDK as a package deal with your Eclipse or did you install it separately?  What version are you running?



I am using JDK 1.4.2, and I installed separately from Eclipse.  This is a nuisance, but not something I am going to spend a lot of time on.  I appreciate your brainstorming...
I'm on 1.5, but that shouldn't matter... These types of things usually end up being something small and easily overlooked.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial