Viewing complete strings while debugging in Eclipse

In the Variables view you can right click on Details pane (the section where the string content is displayed) and select "Max Length..." popup menu. The same length applies to expression inspector popup and few other places.

enter image description here


If you have a really long string, I use a different strategy: dump it to a file. I have a snippet of code I use in the Display view, which is evaluated to dump the data to a file. I use Commons IO, but you can do it with JDK only methods.

org.apache.commons.io.FileUtils.writeStringToFile(new java.io.File("<filename>"), <expression to evaluate>);

Naturally, you will need the Commons IO JAR in your classpath for that to work. If you don't, resort to JDK work.


In the Variables view you right-click on the variable and select Change value. If your variable is huge you have to wait a few minutes (in this case Eclipse doesn't respond to commands) but in the end Eclipse will show your variable entirely.


The best way to view a String value from eclipse debug view is as below.

1) Switch to debug view in Eclipse

2) Select the desired variable in variable pane.

3) Right click on display area of variable pane where value is shown and click on Max Length. Enter the maximum char value in Configure Details Pane .

4) Cheers

enter image description here