我在用jdk运行时出现这样的错误是为什么呀?到底哪里错了?请各位帮帮忙谢谢~
e:\java code>javac TestMyDate.java
javac:找不到文件:TestMyDate.java
用法:javac<options><source files>
-help 用于列出可能的选项

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【yangchunhuo】截止到2008-07-02 14:57:30的历史汇总数据(不包括此帖):
    发帖的总数量:3                        发帖的总分数:60                       
    结贴的总数量:0                        结贴的总分数:0                        
    无满意结贴数:0                        无满意结贴分:0                        
    未结的帖子数:3                        未结的总分数:60                       
    结贴的百分比:0.00  %               结分的百分比:0.00  %                  
    无满意结贴率:---------------------无满意结分率:---------------------
    如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
      

  2.   

    你的 java 文件没有当前目录吧? 或者是你的 classpath 里面没有点(当前目录'.')
      

  3.   

    TestMyDate.java没有放在e:\java code目录里
      

  4.   

    找不到文件,你的 TestMyDate.java 是放在哪里的
      

  5.   

    环境变量里的classpath是不是类似如下
    .;D:\Program Files\JDK\lib\dt.jar;D:\Program Files\JDK\lib\tools.jar
    主要是前面的.;两个字符
      

  6.   

    你这个程序是不是有package,同时又引用了同包里的其他类
    如果是这样,运行的时候就要把同包的类引进来
    试试javac -classpath .. TestMyDate.java 
      

  7.   

       public class MyDate {
        private int day; //日
        private int month; //月
        private int year;  //年
        public MyDate(int day,int month,int year){
        this.day   = day;
        this.month = month;
        this.year  = year;
        }    public MyDate(MyDate date) {
        this.day   = date.day;
        this.month = date.month;
        this.year  = date.year;
        }    public int getDay() {
        return day;
        }    public void setDay(int day) {
        this.day = day;
        }    public MyDate addDays(int more_days) {
        MyDate new_date = new MyDate(this);
        new_date.day = new_date.day + more_days;
        return new_date;
        }    public void print() {
        System.out.println("MyDate: " + day + "-" + month +    "-" + year);
        }
        } public class TestMyDate {
        public static void main(String[] args) {
        MyDate my_birth = new MyDate(22, 7, 1964); //通过第一个构造函数new了一个叫my_birth的对象,并在参数里面赋值    MyDate the_next_week = my_birth.addDays(7); //这个对象调用了addDays(int more_days)的方法,赋值给the_next_week的变量
        the_next_week.print(); //调用print()方法
        }
        } 
      

  8.   

    你真是太强了,TestMyDate类里用了好多中文的标点和括号还有空格
    public class TestMyDate
    {
        public static void main(String[] args)
        {
            MyDate my_birth = new MyDate(22, 7, 1964); //通过第一个构造函数new了一个叫my_birth的对象,
                                                       // 并在参数里面赋值        MyDate the_next_week = my_birth.addDays(7);//这个对象调用了addDays(intmore_days
                                                       // )的方法,赋值给the_next_week的变量
            the_next_week.print();// 调用print()方法
        }
    }
      

  9.   

    这两个类在同一个文件里吗?MyDate类就不能是public
    public class TestMyDate { 
        public static void main(String[] args) { 
        MyDate my_birth = new MyDate(22, 7, 1964); //通过第一个构造函数new了一个叫my_birth的对象,并在参数里面赋值     MyDate the_next_week = my_birth.addDays(7); //这个对象调用了addDays(int more_days)的方法,赋值给the_next_week的变量 
        the_next_week.print(); //调用print()方法 
        } 
        } 你这段代码里的括号,分号等不是半角的
      

  10.   

        class MyDate {
        private int day; //日
        private int month; //月
        private int year;  //年
        public MyDate(int day,int month,int year){
        this.day=day;
        this.month=month;
        this.year=year;
        }    public MyDate(MyDate date) {
        this.day=date.day;
        this.month=date.month;
        this.year=date.year;
        }    public int getDay() {
        return day;
        }    public void setDay(int day) {
        this.day=day;
        }    public MyDate addDays(int more_days) {
        MyDate new_date=new MyDate(this);
        new_date.day=new_date.day + more_days;
        return new_date;
        }    public void print() {
        System.out.println("MyDate: "+day+"-"+ month+"-" + year);
        }
        } public class TestMyDate {
        public static void main(String[] args) {
        MyDate my_birth=new MyDate(22,7,1964); //通过第一个构造函数new了一个叫my_birth的对象,并在参数里面赋值    MyDate the_next_week=my_birth.addDays(7); //这个对象调用了addDays(int more_days)的方法,赋值给the_next_week的变量
        the_next_week.print(); //调用print()方法
        }
        } 
      

  11.   

    这样,只要这一个就行了class MyDate
    {
        private int day; // 日    private int month; // 月    private int year; // 年    public MyDate(int day, int month, int year)
        {
            this.day = day;
            this.month = month;
            this.year = year;
        }    public MyDate(MyDate date)
        {
            this.day = date.day;
            this.month = date.month;
            this.year = date.year;
        }    public int getDay()
        {
            return day;
        }    public void setDay(int day)
        {
            this.day = day;
        }    public MyDate addDays(int more_days)
        {
            MyDate new_date = new MyDate(this);
            new_date.day = new_date.day + more_days;
            return new_date;
        }    public void print()
        {
            System.out.println("MyDate: " + day + "-" + month + "-" + year);
        }
        
        public static void main(String[] args)
        {
            MyDate my_birth = new MyDate(22, 7, 1964); //通过第一个构造函数new了一个叫my_birth的对象,
                                                       // 并在参数里面赋值        MyDate the_next_week = my_birth.addDays(7); // 这个对象调用了addDays(int
                                                        // more_days
                                                        // )的方法,赋值给the_next_week的变量
            the_next_week.print(); // 调用print()方法
        }
    }
      

  12.   

    看看java -version能不能运行,不能的话就是你path没配置
    能跑的话就是你Classpath配置不对
      

  13.   


    应该是正解了,好好确认下,别偷懒!!
    在“e:\java code>”下输入“dir Test*.java”确认下有没