Eclipse "Unable to install breakpoint due to missing line number attributes..."

 Eclipse下Debug時彈出錯誤“Unable to install breakpoint due to missing line number attributes,Modify compiler options to generate line number attributes"

遇到這個錯誤時找到的解答方案彙總:
1、使用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 within eclipse. ant controls it's own compiler settings.you can tell ant to generate debugging info like this 'javac ... debug="true".../>(我的問題是因爲這個原因);
2、編譯器的設置問題,window->preferences->java->Compiler在compiler起始頁,classfile Generation區域中確認已經勾選了All line number attributes to generated class files。如果已經勾選,從新來一下再Apply一下。或者從項目層次進行設定,項目屬性->java compiler同樣在起始頁,確定已經勾選
Eclipse報的這個錯,無非就這兩個原因造成的

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章