Return-Path: X-Original-To: apmail-ant-user-archive@www.apache.org Delivered-To: apmail-ant-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F1C384DA for ; Mon, 22 Aug 2011 13:07:32 +0000 (UTC) Received: (qmail 86726 invoked by uid 500); 22 Aug 2011 13:07:31 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 86609 invoked by uid 500); 22 Aug 2011 13:07:30 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 86601 invoked by uid 99); 22 Aug 2011 13:07:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2011 13:07:29 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of prvs=208467c3c=santanu.basu@tcs.com designates 121.241.215.10 as permitted sender) Received: from [121.241.215.10] (HELO inkolg01.tcs.com) (121.241.215.10) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Aug 2011 13:07:21 +0000 X-IronPort-AV: E=Sophos;i="4.68,263,1312137000"; d="scan'208";a="198133051" In-Reply-To: References: To: "Ant Users List" MIME-Version: 1.0 Subject: Re: Ant not respecting JAVA_HOME X-KeepSent: 8BE62849:F4CA626B-652578F4:00483D6F; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.1 February 07, 2008 Message-ID: From: Santanu Basu Date: Mon, 22 Aug 2011 18:37:02 +0530 X-MIMETrack: Serialize by Router on InKolM02/TCS(Release 8.5.2FP2|March 22, 2011) at 08/22/2011 18:36:59, Serialize complete at 08/22/2011 18:36:59 Content-Type: multipart/alternative; boundary="=_alternative 0048BF9D652578F4_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 0048BF9D652578F4_= Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" Have you done this? C:\Users\Brian>cd C:\AntTest C:\AntTest>set JAVA_HOME=C:\Program Files\Java\jdk.1.6.0_23 C:\AntTest>set ANT_HOME=C:\Program Files\Apache Software Foundation\apache-ant-1.8.2 C:\AntTest>%ANT_HOME%\bin\ant The above should work. Which version of Ant you are using? Thanks, Santanu From: Brian FitzGerald To: Ant Users List Date: 08/22/2011 06:06 PM Subject: Re: Ant not respecting JAVA_HOME Thank you for the response, Santanu. > Do you have the build.xml in the directory from where you are running ant? > How you are calling ant? I didn't before, but since you mentioned it I grabbed a simple hello world build file and put that in a directory called C:\AntTest -- I am calling Ant from the Window command line by navigating to the AntTest directory and then typing the "Ant" command. > You can create a script and set the java_home just before calling > %ANT_HOME%/bin/ant. Do you mean I can set the JAVA_HOME variable within the build.xml? Or with a command each time I run the script? I have tried setting JAVA_HOME immediately before running the Ant command in the Windows command line but got the same result. >The ANT_HOME should be C:\Program Files\Apache Software >Foundation\apache-ant-1.8.2 >and not C:\Program Files\Apache Software Foundation\apache-ant-1.8.2\bin >Try putting jdk.1.6.0_23 and apache-ant-1.8.2 in a folder which does not contain spaces. Sorry, I mistyped the ANT_HOME path in the original post, I actually had the path set correctly. Regardless, I have gone ahead and moved Ant to a directory with no spaces as you suggested: C:\Ant and changed the ANT_HOME environment variable accordingly. I did not move the jdk because I'm a little concerned that other apps are using it and I'm gonna mess something up (kinda new at this). So anyway, now when I run the build (with the build.xml in place), I get: C:\Users\Brian>cd C:\AntTest C:\AntTest>Ant Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar Buildfile: C:\AntTest\build.xml hello: [echo] Hello, World BUILD SUCCESSFUL Total time: 0 seconds Buttom line: Ant is still looking in the wrong directory for Java (jre instead of jdk). Any idea what I could be doing wrong? Thanks, Brian =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you --=_alternative 0048BF9D652578F4_=--