我意识到这已经被问了很多,但无法从这些答案中找出问题所在。
我有一个抽象类任务:
package crowdtrust;
public abstract class Task
{
public enum Type
{
BinaryImageClassification;
};
public abstract void assignCrowd();
};
一个实施任务:
package crowdtrust;
import java.util.Collection;
import java.util.List;
public class BinaryTask extends Task
{
private List<SubTask> subtasks;
public BinaryTask(String name, String question)
{
super();
this.name = name;
this.question = question;
}
public boolean assignSubtask(SubTask s)
{
return subtasks.add(s);
}
public void assignCrowd()
{
//TODO
}
};
和子任务类:
package crowdtrust;
public class SubTask {
//not important
}
这些都在 ct/src/crowdtrust
从 ct 我运行这个 makefile:
CONTEXT = webapps/ROOT
SRCDIR = src
CLASSDIR = $(CONTEXT)/WEB-INF/classes
LIBDIR = $(CONTEXT)/WEB-INF/lib
JAVAC = javac
SOURCES = $(wildcard $(SRCDIR)/crowdtrust/*.java)
CLASSES = $(SOURCES:.java=.class)
all: install clean
clean:
rm -f $(CLASSES)
install: $(CLASSES)
install -m600 $(CLASSES) $(CLASSDIR)/crowdtrust
%.class: %.java
$(JAVAC) -cp $(LIBDIR) $<
得到这些(加上更多类似的)错误:
javac -cp webapps/ROOT/WEB-INF/lib src/crowdtrust/BinaryTask.java
src/crowdtrust/BinaryTask.java:6: cannot find symbol
symbol: class Task
public class BinaryTask extends Task
^
src/crowdtrust/BinaryTask.java:9: cannot find symbol
symbol : class SubTask
location: class crowdtrust.BinaryTask
private List<SubTask> subtasks;
^
任何想法是什么导致了错误?