Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse doesn't remember source lookup path

Tags:

java

eclipse

For some reason Eclipse doesn't remember source lookup path for some java projects, and every time during debugging (after redeploying) I need to press "Edit source lookup path" button and add current project to the list.

Does anyone know how to make it remember selected source location?

EDIT: It is a tomcat project, built with ant. Eclipse version is 3.2.2

.classpath looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="output" path="web/WEB-INF/classes"/>
    <classpathentry kind="lib" path="web/WEB-INF/lib/commons-collections-3.2.jar"/>
    ... bunch of libs here
</classpath>

UPDATE: I found required setting - it is under General Preferences -> Tomcat -> Source path.

like image 581
serg Avatar asked Jan 29 '09 19:01

serg


People also ask

What is source lookup path in eclipse?

Source Lookup Path A source location is a description of one (or more) source repositories. At launch time, source locations are translated (resolved) into a collection of actual source repositories.


2 Answers

Try looking at the Run/Debug configuration for what you are executing, and check the source tab. You can add elements manually, but that is really not recommended.

The elements in the source tab are based on the classpath of the project containing the element that you run. In the case of running tomcat, the source path simply contains all the web projects that are associated with tomcat (and their dependencies).

like image 75
Yoni Avatar answered Sep 18 '22 07:09

Yoni


Solution is:
Window / Preferences
Tomcat / Source Path

Click your project name. Don't forget to change it if you cahnge to another project!

like image 43
Vilmos Kiss Avatar answered Sep 18 '22 07:09

Vilmos Kiss