Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up spring source code for debugging in eclipse

I'm trying to set up the spring source code in an eclipse project so that I can step through it with the debugger.

Currently, the specific line of code I'm trying to step into is this one:

ApplicationContext context=new ClassPathXmlApplicationContext("classpath:spring.xml");

ApplicationContext and ClassPathXmlApplicationContext are part of org.springframework.context:

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

Under "Java Build Path"=>"Libraries", I've specified the path to the file org.springframework.context-sources-3.1.3.RELEASE.jar for org.springframework.context-3.1.3.RELEASE.jar.

enter image description here

I'm using spring 3.1.3 with eclipse indigo 3.7.2.

Update:

I tried adding the sources.jar files to the source tab under "Debug Configurations" but eclipse is still not finding the source.

enter image description here

like image 828
opike Avatar asked Nov 11 '12 19:11

opike


1 Answers

Try below:

Menu Option Run -> Debug Configurations -> Java Application 
   Provide required inputs in "main" tab
   Add source jar file in source tab

Press OK and run this newly created option to debug.

If running remote, then select Remote Java Application in debug configuration's left pane.

like image 131
Yogendra Singh Avatar answered Oct 02 '22 14:10

Yogendra Singh