9

I am doing remote debugging of a Java application and using the debug view of Eclipse. The basic debugging process is working fine and I can see the method stack traces in debug view at the relevant breakpoints. However, I am not seeing the corresponding source code in the tab below and it is saying:

Source not found

The source files are already in my Eclipse project and I can see them in the Java view. I have edited the source look up paths and added the *.java files to it. But even then I am not seeing the source code in the debug view where the execution halts. Any clues on this would be appreciated.

2
  • 1
    I have experienced this in the past when using a compiled JAR and a separate sources JAR together (BouncyCastle PGP libraries, to be precise). The compiled JAR had line numbers stripped, which prevented the debugger from knowing how to step through the sources JAR. The solution was to rebuild the JAR from the sources, without removing line numbers. Commented Aug 21, 2012 at 12:42
  • Please post snapshot of classpath also. Commented Aug 21, 2012 at 12:43

3 Answers 3

13

For the Run/Debug configuration that you have been using to Remote Debug, have you followed these steps :

  1. “Run -> Debug configurations…”
  2. Choose the remote config from the tree on the left
  3. Click on the “Source” tab
  4. Click on the “Add…” button
  5. Follow the wizard (add the Project containing the source which is being debugged).

If so, can you post a snapshot of the Run Configuration ?

What I have usually done with a Remote Debug run configuration is Add Source as Java Projects to the Source tab on the Run/Debug configuration. Thus to add a project called so, I would proceed as follows :

enter image description here

And when choosing the project, select the two checkboxes :

enter image description here

To end up with this finally :

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Sometimes the error still appears after adding the project. To fix this, try to run Eclipse from command line with -clean option.
4

I have done the below steps and it worked for me:

  1. Run > Run Configurations
  2. Java Application > Click on Source Tab
  3. Include the project by selecting the option "File System Directory"
  4. Debugging started showing the source code.

1 Comment

Thanks Arpita, this is the solution minus the confusion
1

You are probably using JRebel which is automatically recompiling and reloading classes. Unfortunately Eclipse Debugger doesn't work with class realoaded in this way. In order to make sure that Eclipse will work fine with the class after changes you have to restart your web application container.

1 Comment

JRebel doesn't recompile code, it operates with *class files. For Eclipse debugger, you need the IDE plugin to be installed to help the debugger to help it to identify the new code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.