views:

80

answers:

2

I am using Eclipse Ganymede.

I have a project open and call a static method of a class in another project, which the current one references.

I close the current project, open the referenced library's project, change the method return type, and rebuild its jar. (It's set to build automatically, but I tried explicitly rebuilding all anyway.)

When I go back to the original project, it still thinks that the static method returns the old type. What am I doing wrong?

P.S., "refresh" on the context menu doesn't fix it either.

+1  A: 

The problem may depend on how the first project references the class file in the second. If it has a hard-coded classpath to a jar produced by the second project, you'll need to make sure that jar file is properly updated where it is linked from.

Since you control both projects, ideally the first project would be dependent on the second project as a "project dependency", not as a jar dependency (then it would automatically sync changes between the two)

You can find a list of those projects (and add to them) by right-clicking on the project, selecting Build Path -> Configure Build Path, and switching to the Project tab.

Aaron
Still missing something. In Projects tab, "Required projects on the build path" listbox is empty. Clicking "Add..." button brings up "Select Projects to Add" list, which is also empty. Apparently, referencing libraries is not enough to add their projects to those recognized by my current project?
Buggieboy
A: 

I think the jar file was out of date. I ended up deleting the old one, selecting the project to be referenced, and clicking "Export". At that point, I was able to indicate that all classes and resources in the project should be exported to a jar in the folder I specified.

Buggieboy