你应该吧public class OrderModel extends ValueObject改为public class OrderModel extends com.bill.server.components.model.ValueObj
ect 式式

解决方案 »

  1.   

    Read this will help you understand package.1. firstly, you should have a directory to store the class file(etc.: ".\MyPak")2. secondly, you should declare the package that the class belong to.(etc.: "package MyPak;")3. thirdly, import the package(etc.: "import MyPak.*;").pay attention to that: the directory should have the same spell as package declare clause.For example://MyAge.java
    package MyPak;
    public class MyAge{
      private String myAge;
      public void setMyAge(String age){
        myAge = age;
      }  public String getMyAge(){
        return myAge;
      }
    }//Test.java
    import MyPak.*;
    public class Test{
      public static void main(String[] args){
        MyAge df = new MyAge(); df.setMyAge("24");
    System.out.println("My age is: "+df.getMyAge());
      }
    }There is a file named "Test.java" in current directory
    and I need to put the "MyAge.class" in (<current directory>\MyAge).Then you will compile correct.
      

  2.   

    我建议你用一下IDE吧,比如jb之类的,这样毛病会少一些。关于找不到类的问题,我认为 johnwesley(我心荡漾(终于发现无界限)) 说的对!
      

  3.   

    目录结构问题啊。在你的当前目录下有
    com/bill/server/components/model/ValueObject.class
    吗?
    从你的错误看,应该没有。方法,
    1.使用ant,这是最好的方法
    2.用IDE,这个就不多说了
    3.进入com之前的目录。按你的包情况,你的目录结构应该是:
    D:/com/bill/server/components/model/
    下面有:ValueObject.class  OrderModel.java
    那么进入D:\ (这个不用教吧)
    执行javac com/bill/server/components/model/OrderModel.java
    或者是进入D:/com/bill/server/components/model/
    执行javac -classpath D:\;%CLASSPATH% OrderModel.java
    或者set CLASSPATH=d:\;YOUR_CLASSPATH
    javac OrderModel.java自己领悟吧