views:

128

answers:

1

I have a java project. The working folder from someone else's Eclipse project (It was a Repast Simphony project I think).

In my eclipse I created a new Java project and told it to use the existing code. So it seems to have brought in all the code.

However after loading the project I get this error:

Project 'My Project' is missing required Java project: 'Weka 3-7' 

It has a .classpath file with these contents:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
 <classpathentry kind="src" path="src"/>
 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 <classpathentry combineaccessrules="false" kind="src" path="/Weka-3-7"/>
 <classpathentry kind="output" path="bin"/>
</classpath>

What I've tried so far:

I installed Weka 3-7. Then I updated the .classpath file to say the following and reloaded the project.

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
 <classpathentry kind="src" path="src"/>
 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 <classpathentry combineaccessrules="false" kind="src" path="C|/Program Files/Weka-3-7"/>
 <classpathentry kind="output" path="bin"/>
</classpath>

But now I get the error message:

Project 'My Project' is missing required source folder: 'C|/Program Files/Weka-3-7' 

Please help. I'm stuck.

+2  A: 

You want to use the context menu: My Project::(right mouse click)::Build Path::Configure Build path. This gives you the option to add/remove projects, Jars, source folders etc., what erver you need to provide those classes that your project references. You can get the same effect by hacking the .classpath manually, but you have to know very well what you're doing. Always use the frontend unless it absolutely can't do what you need.

Kilian Foth
Thanks. Any ideas what settings I'd use in the Configure build path dialog to replicate what the .classpath was originally doing? I tried the "link source" option but now I'm getting all kinds of errors of the nature: "ArffReader cannot be resolved to a type", etc.
Greg
The `kind="src"` entries in the `.classpath` are created by putting stuff into the "Source" or "Projects" tabs of the Java Build Path wizard, son you can't reproduce them until you actually *have* the corresponding Java project registered in your workspace (or have the Java sources within your own project).
Kilian Foth
So choosing "link source" is correct?
Greg