轉自:
http://blog.csdn.net/caihaijiang/article/details/5903154Eclipse下Debug時,彈出錯誤提示:“Unable to install breakpoint due to missing line number attributes. Modify compiler options to generate line number attributes”,無法進行調試。
遇到這個錯誤時找到的解答方案匯總:
1、修改Eclipse的java編譯器使用jdk,而不是jre;
2、使用Ant編譯時,未打開debug開關,在寫javac 任務時,設置debug="true",否則不能調試。THe settings for the eclipse compiler don't affect the ant build and even if you launch the ant build from withineclipse. ant controls it's own compiler settings.you can tell ant to generate debugging info like this 'javac ... debug="true".../>;(我遇到的問題,是采用這個辦法解決的)
3、編譯器的設置問題,window->preferences->java->Compiler在compiler起始頁,classfile Generation區域中確認已經勾選了All line number attributes to generated class files。如果已經勾選,從新來一下再Apply一下。或者從項目層次進行設定,項目屬性->java compiler同樣在起始頁,確定已經勾選。
Eclipse編譯時出現Outof Memory問題,解決辦法如下:
window->preferences->java->Installed JREs,選擇安裝的jre(如jdk1.5.0),單擊右邊按鈕“Edit”,彈出“Edit JRE”的對話框,在Default VM Argument的輸入框中輸入:-Xmx512m,然后按確定,即可。(-Xms是設定最小內存,-Xmx是設定最大內存)