DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=37733>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=37733 Summary: ANT from a java program: How catch exception? Product: Ant Version: 1.6.5 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Core AssignedTo: dev@ant.apache.org ReportedBy: [EMAIL PROTECTED] I want call ANT from my java code. To do this, the ANT class org.apache.tools.ant.launch.Launcher is available. The only public access of this class is the main method (Launcher.main(String[] args)). If the launcher generates an exception how can I catch it from my java code? The first idea is to code the "main" method content in my java class try { Launcher mylauncher= new Launcher(); mylauncher.run(args); //args : my array of arguments } catch (LaunchException e) { // ... do something } This code is not possible because the "run" method is private. (private void run (String[] args) throws LaunchException, MalformedURLException {) The second idea is to rewrite the entire class org.apache.tools.ant.launch.Launcher but this solution is not correct. Have-you any solution to solve this problem? Regards. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]