I’m having a really difficult time getting eclipse to play nicely with this external jar. If I add it to the build path, it references its absolute path and works fine. If I edit the .classpath file to use a relative path, it still works fine. However, if I check out my project from scratch, it fails to find ONE class only.
All I have to do is change any one of the paths in the .classpath file and save it and the project hooks everything up. Afterwards, I can change it back to the relative path and all is well. I don’t even have to change the path to the jar that the offending class is in. It’s like Eclipse refuses to acknowledge the directory until it has been referenced at least once via absolute path.
Does this make any sense? I’m not very practiced with eclipse or project builds, but I’d really like to get this project to the point where someone can check it out and build it without having to make further changes.
Here’s the .classpath file:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="res/twitter4j-core-2.2.5-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="res/twitter4j-stream-2.2.5-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="res/jung-algorithms-2.0.1.jar"/>
<classpathentry kind="lib" path="res/jung-graph-impl-2.0.1.jar"/>
<classpathentry kind="lib" path="res/jung-visualization-2.0.1.jar"/>
<classpathentry kind="lib" path="res/collections-generic-4.01.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
The error I receive is:
The type edu.uci.ics.jung.graph.Graph cannot be resolved. It is indirectly referenced from required .class files
If I change one of the paths to “C:/work/thisWS/ThisProject/res/jung-algorithms-2.0.1.jar” for example, the error goes away. I hit undo until the file is back at its initial state and save it again. No problems.
Can anyone shed light on this behavior?
I updated Eclipse to the latest version and this problem ceased. I’m not sure if something else was involved, but I can no longer reproduce it, so I’m marking the question answered.