开发者

Eclipse Library Reference Out of Date in Project

I am using Eclipse Ganymede.

I have a project open and call a static method of 开发者_Go百科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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜