Here is a part of my build.xml:
<target name="run">
<java jar="${jar.dir}/${Main.class}.jar"
fork="yes"
<assertions>
<enable />
</assertions>
</java>
</target>
or
<target name="run">
<java classname="${Main.class}" classpath="${classes.dir};${lib.dir}" fork="yes"/>
</target>
Here is an example java code:
public class Test {
public Test() {
System.out.print("Test2");
}
public static void main(String[] args) {
System.out.println("Test1");
new Test();
while(true) {}
}
}
If I run this code from command line I have "Test1" and then "Test2". If I run this code using the Ant I have only "Test1".
How can I solve this problem?