轉(zhuǎn)自:
http://blog.csdn.net/caihaijiang/article/details/5903154Eclipse下Debug時(shí),彈出錯(cuò)誤提示:“Unable to install breakpoint due to missing line number attributes. Modify compiler options to generate line number attributes”,無(wú)法進(jìn)行調(diào)試。
遇到這個(gè)錯(cuò)誤時(shí)找到的解答方案匯總:
1、修改Eclipse的java編譯器使用jdk,而不是jre;
2、使用Ant編譯時(shí),未打開(kāi)debug開(kāi)關(guān),在寫(xiě)javac 任務(wù)時(shí),設(shè)置debug="true",否則不能調(diào)試。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".../>;(我遇到的問(wèn)題,是采用這個(gè)辦法解決的)
3、編譯器的設(shè)置問(wèn)題,window->preferences->java->Compiler在compiler起始頁(yè),classfile Generation區(qū)域中確認(rèn)已經(jīng)勾選了All line number attributes to generated class files。如果已經(jīng)勾選,從新來(lái)一下再Apply一下?;蛘邚捻?xiàng)目層次進(jìn)行設(shè)定,項(xiàng)目屬性->java compiler同樣在起始頁(yè),確定已經(jīng)勾選。
Eclipse編譯時(shí)出現(xiàn)Outof Memory問(wèn)題,解決辦法如下:
window->preferences->java->Installed JREs,選擇安裝的jre(如jdk1.5.0),單擊右邊按鈕“Edit”,彈出“Edit JRE”的對(duì)話框,在Default VM Argument的輸入框中輸入:-Xmx512m,然后按確定,即可。(-Xms是設(shè)定最小內(nèi)存,-Xmx是設(shè)定最大內(nèi)存)