Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse "Class File Editor" Source Not Found While Debugging

I have a project in Java that I am stepping through and when I'm using external libraries e.g. jdom.jar I end up hammering step over to get out on the "Class File Editor". I really don't care about whats in these libraries I'm just using them to process things for my own code.

Is there anyway to get around this popping up?

It's so frustrating hammering step over every time I accidentally step into a class file which I know has no source and is completely pointless me looking through.

image below:

enter image description here

like image 326
MrPink Avatar asked Mar 30 '12 09:03

MrPink


People also ask

How do I open class editor in eclipse?

Go to Project > Properties > Java Build Path > LibrariesSelect Source attachment and double click or Edit. Type path the source code file (External File…) and press OK. Show activity on this post. Show activity on this post.

How do I debug a .class file in eclipse?

There are two ways to debug a class file. The first way is to set the decompiler preference, and to realign the line number. The second way is to check the debug mode in the decompiler menu bar. When your Eclipse workspace is in debug perspective, the debug mode becomes the default.


2 Answers

  1. Install Enhanced Class Decompiler from Eclipse Marketplace, restart when prompt.
  2. Go to Preferences->General->Editors->File Associations, selected both ".class" and ".class without source" associating them to Class Decompiler Viewer as default.
  3. In Preferences->Java->Decompiler check that the Default Class Decompiler suits your JDK version.
like image 73
Hugo Hernandez Avatar answered Oct 15 '22 13:10

Hugo Hernandez


Simple way-- Works for me :)

Select Attach Source->(External Location Radio Box)External File-> Select src.zip from java/jdk1.x.x.xx folder

and done!!

like image 20
user6475139 Avatar answered Oct 15 '22 14:10

user6475139