有语法错误的源文件 用Eclipse可以编译通过,并生成class文件。
反编译这个class文件,发现错误的地方是这样的
public static void aa()
{
throw new Error("Unresolved compilation problem: \n\tSystem.ou cannot be resolved\n");
}
请问能否用javac或ant实现这种编译?我以前是用MyEclipse来发布web工程,现在想用ant来自动发布,其他方面都还好,就这个地方跟用MyEclipse发布不一样,MyEclipse可以生成类文件,ant却不行。
反编译这个class文件,发现错误的地方是这样的
public static void aa()
{
throw new Error("Unresolved compilation problem: \n\tSystem.ou cannot be resolved\n");
}
请问能否用javac或ant实现这种编译?我以前是用MyEclipse来发布web工程,现在想用ant来自动发布,其他方面都还好,就这个地方跟用MyEclipse发布不一样,MyEclipse可以生成类文件,ant却不行。
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList<String> a1 = new ArrayList<String>();
a1.add("a1");
a1.add("1");
ArrayList<String> a2 = new ArrayList<String>();
a2.add("a2");
a2.add("2");
a2.addAll(a1);
for(int i = 0; i < a2.size(); i++) {
System.out.println(a2.get(i));
}
}}
a2
2
a1
1