ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Bengl <>
Subject AntLauncher: avoid exiting VM!
Date Sat, 01 Jul 2006 10:56:24 GMT
Hi Folks,

I'm using the AntLauncher to start ant out of a java environment. after 
running the ant script the vm should not quits!
The class has a member called 
MAIN_CLASS with the value** "" **.
This class has a exit method which calls System.exit. the exit method is 
protected - so its possible to extend the class and overwrite the exit 
the problem: the member MAIN_CLASS of the Launcher class is final static 
- it is not possible to change the value programmaticly.
could you change this?

static getter and setter would be fine:

public static String mainClassName = MAIN_CLASS;

public static void setMainClassName(String newMainClass)
  mainClassName = newMainClassName;

using in method run(..) without exception handling:

Class mainClass = loader.loadClass(mainClassName);


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message