package people;public class Person {       public String name;
       public int age;
       public char sex;       public void speeking(){
        System.out.println("Hello ,everyone !");
       }
}
============================================================package people.school;
import people.*;
public class Student extends Person{       public String stID;
       public String major;       public Student(String name,int age,char sex,String stID,String major){
        this.name=name;
        this.age=age;
        this.sex=sex;
        this.stID=stID;
        this.major=major;
       }       public void speeking(){
        super.speeking();
        System.out.println("My name is "+name);
        System.out.println("My age is "+age);
        System.out.println("My sex is "+sex);
        System.out.println("My stID is "+stID);
        System.out.println("My major is "+major);
       }
}
============================================================package people.school;
import people.*;
public class Teacher extends Person{        public String sch;        public Teacher(String name,int age,char sex,String sch){
         this.name=name;
         this.age=age;
         this.sex=sex;
         this.sch=sch;
        }        public void speeking()
        {
          super.speeking();
         System.out.println("My name is "+name);
          System.out.println("My age is "+age);
          System.out.println("My sex is "+sex);
          System.out.println("I'm a teacher of "+sch);
        }
}============================================================package people.school;import people.school.*;public class Test {
        public static void main(String args[]){
         Student s=new Student("Zhang san",19,'F',"091001","Computer&community");
         Teacher t=new Teacher("Wang wu",30,'M',"Lanzhou University science & Technology");
           
         s.speeking();
         t.speeking();
        }   
}  //JVM Launcher: Could not find the main class .Program will exit.

解决方案 »

  1.   

    //JVM Launcher: Could not find the main class .Program will exit.
    看你这个错误提示,应该是没有写主方法,程序找不到切入点,就是public static void main(String[] args){}这个方法
      

  2.   

    我知道eclipse这个编译器经常会出现此类问题,我一般解决方法是先重新启动eclipse,有时候可能是eclipse自己运行时间长导致出现的问题。
    然后如果重新启动不管用
    那就要看看你对eclipse的buildpath里面的配置了,一般你的class默认输出目录是bin,你看看bin文件夹是否生成了那些class文件
      

  3.   

    不用重启eclipse, 选择Project下面的clean菜单。 选中你的project, clean就好了。
    然后eclipse会重新编译你的程序, 当然你要确保你的project-->build automatially勾上。
    这个问题的根本原因是,虽有java文件,但是没有编译成class,当然
    //JVM Launcher: Could not find the main class .Program will exit.
      

  4.   

    问LZ的编写编译环境具体情况。是纯文本编辑还是IDE编辑?
      

  5.   

    打开DOS,输入 javac -d . *.java 再试试。。
      

  6.   

    都没说在什么情况下运行出错,鄙视。
    如果是用jar直接运行出现这个错误,可能MF文件的问题,没有指定main方法。
    其他的楼上的同志们说了一些。