main()方法错,
应该为:
public static void main(String [] args)
{ try{
System.out.println("Hello World!");
}
catch(Exception e){e.printStackTrace();}
}
应该为:
public static void main(String [] args)
{ try{
System.out.println("Hello World!");
}
catch(Exception e){e.printStackTrace();}
}
D:\jdk1.3>javac aaa.java
aaa.java:1: 期望class或interface
public static void main(String [] args)
^
1 个错误D:\jdk1.3>
{
public static void main(String []args)
{
try{ System.out.println("Hello World!");
}
catch(Exception e){e.printStackTrace();}
}
}
上面代码我在我的机器中测试过没问题.不知你的程序是否改过或者在main()中有返回值
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解析器?
main方法错