From dev-return-59326-apmail-ant-dev-archive=ant.apache.org@ant.apache.org Mon Jul 19 23:59:36 2004 Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 75315 invoked from network); 19 Jul 2004 23:59:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 19 Jul 2004 23:59:36 -0000 Received: (qmail 22266 invoked by uid 500); 19 Jul 2004 23:59:30 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 22205 invoked by uid 500); 19 Jul 2004 23:59:30 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 22181 invoked by uid 99); 19 Jul 2004 23:59:30 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received: from [66.218.93.156] (HELO web41905.mail.yahoo.com) (66.218.93.156) by apache.org (qpsmtpd/0.27.1) with SMTP; Mon, 19 Jul 2004 16:59:28 -0700 Message-ID: <20040719235927.52422.qmail@web41905.mail.yahoo.com> Received: from [203.19.232.65] by web41905.mail.yahoo.com via HTTP; Tue, 20 Jul 2004 09:59:27 EST Date: Tue, 20 Jul 2004 09:59:27 +1000 (EST) From: =?iso-8859-1?q?Rohit=20Mathur?= Reply-To: mathur@pobox.com Subject: Problems running ant within a java application To: dev@ant.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, I am trying to run Ant from within a java application as follows. Project project = new Project(); File buildFile = new File(beansDir, "build.xml"); project.setUserProperty("ant.file", buildFile.getAbsolutePath()); project.setUserProperty("ant.version", Main.getAntVersion()); project.setUserProperty("name", "mdd-ejb"); project.setUserProperty("version", "0.1"); project.setBaseDir(new File(beansDir)); project.addBuildListener(new DefaultLogger()); project.init(); ProjectHelper.configureProject(project, buildFile); project.executeTarget("build"); My build file has a compile target This target fails whenever I run my code saying that it was unable to find a JVM. All other targets (ejbdoclet - which creates the home/remote interfaces for an ejb) work properly. Exception occurred during event dispatching: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK at org.apache.tools.ant.taskdefs....... I do have a JAVA_HOME env var set. I have even tried putting an "executable" arg to the javac tag pointing to the javac executable. I still get the same problem. Any help would be really appreciated. Cheers, Rohit. ===== Rohit Mathur mathur@pobox.com Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org