I debug my program and add here and there a breakpoint. After a stop I want to inspect some of the variables and get sometimes a com.sun.jdi.ObjectCollectedException
Right click the variable, then click "Show Logical Structure", uncheck any collection.
While execution of your code is stopped at a breakpoint:
Variables
paneInstead of turning off logical structure, you can add a logical structure formatter, as detailed in this answer: Eclipse debug mode view instance variable values. This prevents the exception and lets you see the variable in a useful way.
This bug has been fixed in Eclipse 4.18
https://www.eclipse.org/eclipse/news/4.18/jdt.php
Stabilized logical structures in Variables view with active GC
The Debug view no longer breaks when logical structures are shown while the application's garbage collector is active (com.sun.jdi.ObjectCollectedException occurred while retrieving value).