main()方法错,
应该为:
  public static void main(String [] args)
   {               try{
System.out.println("Hello World!");
}
         catch(Exception e){e.printStackTrace();}
   }

解决方案 »

  1.   

    系统报错!
    D:\jdk1.3>javac aaa.java
    aaa.java:1: 期望class或interface
      public static void main(String [] args)
                    ^
    1 个错误D:\jdk1.3>
      

  2.   

    public class aaa
    {
    public static void main(String []args)
    {
               try{ System.out.println("Hello World!");
             }
                   catch(Exception e){e.printStackTrace();}
    }
    }
    上面代码我在我的机器中测试过没问题.不知你的程序是否改过或者在main()中有返回值
      

  3.   

    谢谢!ok了!
    ant 打包时不对!本来我怀疑和jdk有关系!现在看了不是!
    使用ant 来发布ejb!jboss的服务器
    build.xml也写了!
    但是每次运行ant的时候总是
    提示,如下:
    D:\BBS>ant
    Usage: java [-options] class [args...]
              (to execute a class)
      or  java -jar [-options] jarfile [args...]
              (to execute a jar file)
    where options include:
       -cp -classpath <directories and zip/jar files separated by ;>
                     set search path for application classes and resources
       -D<name>=<value>
                     set a system property
       -verbose[:class|gc|jni]
                     enable verbose output
       -version      print product version and exit
       -showversion  print product version and continue
       -? -help      print this help message
       -X            print help on non-standard options
    D:\BBS> build.xml 就在BBS目录下头!
    java_home,ant_home,ant加入path 都设了!
    它的提示!和不代参数运行 java一样!
    是不是要装xml解析器?
      

  4.   

    public static void main(String[] args)
    main方法错
      

  5.   

    请确保当前目录下有build.xml这个文件
      

  6.   

    请问空心菜老兄﹐能不能给我讲讲你ejb实现的过程﹐我现在还不知道怎幺才可以实现呢。谢谢﹗有好心的同任也请帮忙教教我。