java程序在eclipse运行下出错,但是在cmd可以正常运行,求大神!

源代码:
class Person{
private String name;
private String location;

Person(String name){
    this.name = name;
    location = "beijing";
}

Person(String name,String location){
    this.name = name;
    this.location = location;
}

public String info(){
    return "name:"+name+"location:"+location;
}

}

class Student extends Person {
private String school;
Student(String name,
String school) {
this(name,"beijing", school);
}
Student(String n,String l,String school) {
super(n,l);
this.school = school;
}
public String info() {
return super.info()+
" school: "+school;
}
}

class Teacher extends Person{
private String capital;

Teacher(String name,String capital){
    this(name,"beijing",capital);
}

Teacher(String n,String l,String capital){
    super(n,l);
    this.capital = capital;
}

public String info(){
    return super.info()+"location"+capital;
}

}

public class TestTeacher {
public static void main(String[] args) {
Person p1 = new Person("A");
Person p2 = new Person("B","shanghai");
Student s1 = new Student("C","S1");
Student s2 = new Student("C","shanghai","S2");
System.out.println(p1.info());
System.out.println(p2.info());
System.out.println(s1.info());
System.out.println(s2.info());

    Teacher t1 = new Teacher("D","Professor");
    System.out.println(t1.info());
}

}

错误:
Exception in thread "main" java.lang.NoSuchMethodError: Person.(Ljava/lang/String;)Vat TestTeacher.main(TestTeacher.java:55)

person构造函数前面加上public

代码上确实没有看到明显的问题,在 Eclpise 调试时出错就单执行一个,看看出错的哪一行各个变量的值是否是你想要的吧。

不是吧,我测试了你的代码,Eclipse和cmd都没有问题啊。我的环境是jdk1.8+Eclipse Mars Release (4.5.0)。
你的前面三个类是一个Person类文件中,后面的TestTeacher类是一个文件。你是这样的吗?

我把所有的Person都改成Perso就运行出来了。

删除掉。重新试试。排除eclipse 自身的原因。

这个十有八九是你的视图的问题

应该是我之前有一个Person.class,造成混淆啦,谢谢大家的解答。

的确问题不在代码,是文件名、包路径之类的问题