Can't set breakpoints in Eclipse

纵然是瞬间 提交于 2019-12-23 07:55:22

问题


Following the Android notepad tutorials using Eclipse 3.4.2 on OSX 10.5.6.

I'm instructed to set a breakpoint in one of the following ways:

  1. Double click on the gray bar to the left of the editor pane.

    • this just brings up the "Add Bookmark" window
  2. Select "Toggle breakpoint" in the context menu

    • the only options in the context menu are "Go to Annotation..." (which is disabled), "Add Bookmark", "Add Task", "Quick Diff", "Show line numbers", "Folding" and "Preferences"

My guess would be that the editor's in some mode that doesn't allow breakpoints to be set, but I'm only an Eclipse newb. Anyone able to lend any advice here?


回答1:


When you double click the gray bar a blue ball appears? If it appears, try to hover you mouse over it and It may say "Line Breakpoint:Blablabla"

Otherwise, try to check if you are using a java editor to open your file. To check this right click the file you want to open, go to the Open With entry and check if Java Editor is selected, if there is not such option this means that you have not the JDT installed and is probably better to download the Java version of eclipse from its official website.

If none of the previous options helped, its probably a bug and you should report it to the eclipse bug system if you would be so kind.




回答2:


  1. Right click on file(i.e. example.js)
  2. go to Open With
  3. click on Other
  4. click on Internal Editors radio button
  5. Select Java Editor from list

Now you can set the break point by right click and selecting one from available methods i.e. toggle breakpoint / line/method etc.




回答3:


I had the exact same error. I re-started eclipse, but it didn't work. Then I closed all files, and re-opened the file of interest, yet it didn't work. Finally, I went into the Debug perspective, and tried setting the Break-point, and finally it worked for me.




回答4:


All my breakpoints had a diagonal line crossing it. I had this problem, but the reason was that one day before I've clicked in the "Skip all breakpoints" in the debug view. You must uncheck this option. You can access it in the "Run" menu.

Maybe this answer will be useful for someone.




回答5:


This also happens when you try to place debug points in .jsp files. Eclipse won't allow you to debug .jsp files and that is why you are getting that add bookmark pop-up.

Please check the type of file you are working on and place the breakpoints accordingly.



来源:https://stackoverflow.com/questions/664851/cant-set-breakpoints-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!