Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
283 views
in Technique[技术] by (71.8m points)

java - Eclipse console doesn't show the whole output

In Java I tried to write a String as an output to the console. The length of the String is 20166 characters. After printing the string to the console only second half of the String appears.

The whole string is one long line:

What it looks like: From the beginning there is a lot of whitespaces (which are supposed to be alphanumeric characters) and after that there is the rest of the string displayed properly.

I tried to change console encoding from default to UTF-16 and UTF-8, but it didn't help.

The String I am trying to output is text content crawled from a specific webpage (http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery). If I crawl a different webpage there is no problem.

How I process the string: I use a webservice to get the text content from the webpage. The returned String (text contet) is printed properly (whole). I need to process this string so I change all characters to lowercase and replace all multiple whitespaces with the single one.

textContent.toLowerCase().replaceAll("\s+", " ");

After lowercasing the characters I am still able to print whole string properly, but after replacing the multiple whitespaces with one, the beginning of string is not visible.

Do you have any idea what the problem is?

Thakns in advance for any help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is no bug. It is 1 of the changeable settings that Eclipse includes to make the output more readable.

It can be changed by going to Windows --> Preferences --> Run/Debug --> Console and then unchecking "Limit Console Output" which is ON by default.

For more information and details about these settings visit: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fpreferences%2Frun-debug%2Fref-console.htm

This works on STS any version too. This would help printing complete console output.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...