> -----Original Message-----
> From: Fran�ois Lictevout [mailto:
> I'm using Ant inside a java program, (for a task FTP), but there's a
> System.exit(0) in the main class.
> So my programs stops after the ant command.
> To solve the problem, I've downloaded the sources and deleted
> the right
> line. It works now.
> However, I should do it for each new version.
Alternatively, you can change the security manager to avoid System.exit
calls when running Ant (or any class that might do a System.exit).
ie:
public class NullSecurityManager extends SecurityManager {
public void checkExit(int status) {
}
public void checkPermission(java.security.Permission p) {
}
}
SecurityManager oldsm = System.getSecurityManager();
System.setSecurityManager(new NullSecurityManager());
try {
org.apache.tools.ant.Main.main(...);
} finally {
System.setSecurityManager(oldsm);
}
Cheers,
--
St�phane Bailliez
Software Engineer, Paris - France
iMediation - http://www.imediation.com
Disclaimer: All the opinions expressed above are mine and not those from my
company.