From dev-return-70230-apmail-ant-dev-archive=ant.apache.org@ant.apache.org Thu Dec 01 09:47:18 2005 Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 49429 invoked from network); 1 Dec 2005 09:47:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Dec 2005 09:47:03 -0000 Received: (qmail 21761 invoked by uid 500); 1 Dec 2005 09:46:14 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 21719 invoked by uid 500); 1 Dec 2005 09:46:13 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 21708 invoked by uid 99); 1 Dec 2005 09:46:13 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2005 01:46:11 -0800 Received: by ajax.apache.org (Postfix, from userid 99) id 215F1CB; Thu, 1 Dec 2005 10:45:45 +0100 (CET) From: bugzilla@apache.org To: dev@ant.apache.org Subject: DO NOT REPLY [Bug 37733] New: - ANT from a java program: How catch exception? X-Bugzilla-Reason: AssignedTo Message-Id: <20051201094545.215F1CB@ajax.apache.org> Date: Thu, 1 Dec 2005 10:45:45 +0100 (CET) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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: tlame@infovista.com 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: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org