直接用//引入需要的支持类public class test{
 private AdderHome home = null;  public void lookup{
   InitialContext ic = new InitialContext();
           Object objref = ic.lookup("java:comp/env/ejb/Adder");
           System.out.println("lookup ok");
           home = 
              (AdderHome)PortableRemoteObject.narrow(objref, 
                                           AdderHome.class);
  }
  // 创建接口
  public create(){
  }  }调用的时候用   test a = new test();
   a.lookup();
   a.create();
   调用借口方法就可以了