delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/18/00:07:18

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_50
X-Spam-Check-By: sourceware.org
Message-ID: <4BF21268.9020901@bopp.net>
Date: Mon, 17 May 2010 23:07:04 -0500
From: Jeremy Bopp <jeremy AT bopp DOT net>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Script questions
References: <AANLkTimSlMTPZT1PTpWcKb1oNbKCuQ6m-AXr4g-A_Qqk AT mail DOT gmail DOT com>
In-Reply-To: <AANLkTimSlMTPZT1PTpWcKb1oNbKCuQ6m-AXr4g-A_Qqk@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 05/17/2010 10:35 PM, Gregg Levine wrote:
> Hello!
> For the work I do, building and running the Arduino programs first
> from code retreived from SVN and then building it, I am using Cygwin.
> Building prior releases worked without complications.
> 
> I now find out that the latest ones are using Ant from the Apache
> project group to build each. Here's the thing, the script I am
> presenting works to tell the whole system where Java is hiding:
> (Linux)
> #!/bin/sh
> export JAVA_HOME=/usr/lib/java
> export MANPATH="${MANPATH}:${JAVA_HOME}/man"
> export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
> 
> That one works perfectly, no problems whatsoever.
> 
> However the export and translation: (Cygwin)
> GCL AT CmdrSkywalker /etc/profile.d
> $ cat jdk.sh
> #!/bin/sh
> export JAVA_HOME="/cygdrive/c/Program Files/Java"
> #export MANPATH="${MANPATH}:${JAVA_HOME}/man"
> export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
> 
> That one, note the instructions to tell Cygwin where Java lives, only
> tells it where to find the base directory. I am at a minor loss as to
> how to enable the rest of it so as to be able to find the entire tool
> chain. Especially since the company behind Java has its own mindset as
> to how everything is laid out.

The JAVA_HOME environment variable is used by Java, which is a
Windows-native program under Windows.  Since Java is Windows-native, it
doesn't know anything about POSIX paths such as the one you set in your
Cygwin translation.  Apache Ant also assumes that JAVA_HOME uses Windows
paths, and the ant shell script (used when running "ant" from a Cygwin
shell) deals with it appropriately in order to locate your Java
installation based on that fact.

Basically, set JAVA_HOME to a Windows path rather than POSIX path, and
let Ant do the rest for you.  Cygwin itself takes no interest in Sun's
Java or its environment variables.  If you have any other custom
automation which needs knowledge of the Java installation path, you'll
need to model it on the way that Ant handles things surrounding
JAVA_HOME, CLASSPATH, etc.  The ant shell script is reasonably clean and
to-the-point, so you should take a quick peek.

-Jeremy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019