問題描述:Eclipse在Debug模式下,當鼠標移動到某個變量上面時不自動顯示該變量對應的值。
解決方法:在Eclipse中點擊 Window->Preferences->Java->Editor->Hovers, 勾選Variable Values,(如果Combined Hover已經選擇了,就取消它), 然后點擊Apply,最后點OK。
有時不需要勾選Variable Values,只勾選Combined Hover也能查看變量值,所以勾不勾選多試幾下,Debug可能就好了。
Hovers主要是來用配置當鼠標移動到工程中的某一項目上時所需要展示的信息。通過Hovers配置實現一些功能的快捷方式。
主要包括以下幾個屬性的配置:
Combined Hover - Tries the hovers in the sequence listed in above table, excluding this hover, and uses the one which fits best for the selected element and the current context.
Combined Hover:根據當前上下文以及選擇的元素 進行自適應匹配展示。
Variable Values - Shows the value of the selected variable when debugging.
Variable Values :Debug模式下展示當前選擇變量的內容
Problem Description - Shows the description of the selected problem.
Problem Description:顯示當前問題(錯誤)的描述信息
Externalized String - Shows the externalized string of the selected key.
Externalized String: 顯示所選鍵的形象化字符串。
Javadoc - Shows the Javadoc of the selected element..
Javadoc:顯示當前選擇元素的文檔信息
Annotation Description - Shows the description of the selected annotation.
Annotation Description :顯示當前選擇聲明的描述信息。
Source - Shows the source of the selected element.
Source:顯示當前選擇元素的源碼。