MrPink
MrPink

Reputation: 1361

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

Upvotes: 16

Views: 91154

Answers (9)

subhamoy-burman
subhamoy-burman

Reputation: 19

For me the issue was in pom.xml of the debugged project.

In my dependent project - the dependency version was 1.9.3

<dependencies>
        <dependency>
            <groupId>com.aaa</groupId>
            <artifactId>abcautomationlayer</artifactId>
            <version>1.9.3</version>
        </dependency>
    </dependencies>

Whereas it should have been 1.9.3-SNAPSHOT. As the primary project has the version info in that way

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.aaa</groupId>
    <artifactId>abcautomationlayer</artifactId>
    <version>1.9.3-SNAPSHOT</version>

So changing from 1.9.3 -> 1.9.3-SNAPSHOT in dependent project did the trick

Upvotes: 0

Sybuser
Sybuser

Reputation: 1374

Unchecking the option Java -> Debug -> "Use advanced source lookup (JRE 1.5 and higher)" checkbox resolves this issue for me.

Upvotes: 0

Hugo Hernandez
Hugo Hernandez

Reputation: 153

  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.

Upvotes: 3

Preethi
Preethi

Reputation: 123

If you are using gradle, port your dependencies to eclipse classpath by using the eclipse plugin.

Upvotes: 0

Biswajit Karmakar
Biswajit Karmakar

Reputation: 9897

Go to Project > Properties > Java Build Path > Libraries

Expand JRE System Library.

Expand rt.jar.

Select Source attachment and double click or Edit. Type path the source code file (External File…) and press OK.

enter image description here

Upvotes: 5

Aaron Digulla
Aaron Digulla

Reputation: 328536

There are various solutions:

  1. You can download the sources and attach them (select the dependency in the Package Explorer, open the Properties dialog for it, set the path under "Java Source Attachment")

  2. If you don't have the source, install JADClipse

  3. Use "Step Over" (F6) instead of "Step Into" (F5)

  4. If you accidentally stepped into some code, use "Step Return" (F7) to run the whole method and resume debugging after it has returned.

  5. You can tell Eclipse what you don't want to step into using "step filters".

Upvotes: 17

user6475139
user6475139

Reputation: 91

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!!

Upvotes: 9

Mina Fawzy
Mina Fawzy

Reputation: 21452

open 1- help 2- Install New Software in work with click at Add http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update add source code then in attach source chose external location in patch click external file documents - eclipse - plugins - choose package we just download (source code package) example : com.android.ide.eclipse.source...... - 14 sources.zip i hope this work with you

Upvotes: 0

Cyril
Cyril

Reputation: 136

You can try JADClipse

At least you will see the code, and be able to step return and step resume more easily. I don't think there is any way to skip the classes u dont have the source for.

Upvotes: 3

Related Questions