delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/29/18:41:08

X-Spam-Check-By: sourceware.org
Date: Thu, 29 Jun 2006 18:40:54 -0400 (EDT)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: mwoehlke <mwoehlke AT tibco DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Help Understanding Path Issue
In-Reply-To: <e7vd4o$js1$1@sea.gmane.org>
Message-ID: <Pine.GSO.4.63.0606291828560.590@access1.cims.nyu.edu>
References: <006a01c69b13$658a1570$3201a8c0 AT Purcell9100> <e7vd4o$js1$1 AT sea DOT gmane DOT org>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 Wed, 28 Jun 2006, mwoehlke wrote:

> Scott Purcell wrote:
> > I have "CLASSPATHS" and "PATHS" and some "HOME" directories set up.
> > Eg: ANT_HOME value=C:/ant/bin
>
> I assume you meant "CLASSPATH" and "PATH".

I think he meant "CLASSPATH"s and "PATH"s. :-)

> > When I run ant from a "cmd" window all is good. It picks up the value
> > and runs fine. But I do not want to use the "cmd" prompt, and would
> > like to use cygwin. But when I issue ant I get the dreaded error:
> > Error: JAVA_HOME is not defined correctly. We cannot execute
> > /cygdrive/c/jdk1.5.0_02/bin/java

This is actually a bug in ant -- you want to set JAVA_HOME in such a way
that $JAVA_HOME/bin/java exists (i.e., for the Sun JVM you'd set it to
"/cygdrive/c/jdk1.5.0_02/jre").

> > I do not want to change all my HOME, PATH, values because some of the
> > system software uses them as they are. Can I get around this? Is there
> > where it makes sense to use a symbolic link?
>
> Nope, symlinks will not help you (or at least, they probably won't).
> If the program that looks at a particular environment variable is a
> Cygwin program, then the var should give a POSIX path. Otherwise it
> should give a Windows path. You should only have problems switching
> between the two if you have programs of both flavors looking at the same
> variable (other than PATH which Cygwin handles automagically).

Actually, the list of variables automatically translated by Cygwin was
posted here at some point (it may even be in the FAQ).  At the very least
it's PATH, HOME, and LD_LIBRARY_PATH, but there may be others.

In this particular case, ant is the program that does the translation.
Also, the path is used by the Cygwin program (the shell), so the POSIX
version is the right one.

> Example: I assume you are using a non-Cygwin Java (I don't believe I
> have even heard of a Cygwin JVM, so that seems likely), therefore your
> JAVAHOME should be a Windows path, regardless of what shell (A cygwin
> *sh vs. Windows cmd) you are using.

For Java, there are wrapper scripts that make Java understand some POSIX
paths (i.e., it won't translate paths passed as arguments to your Java
program, but it will translate POSIX paths in properties, CLASSPATH, etc).
Currently, the only way to get them is from CVS[1], but I would appreciate
testing and feedback.  However, you don't need those scripts to run ant.
[1] <http://cygwin.com/cgi-bin/cvsweb.cgi/wrappers/java/?cvsroot=cygwin-apps>

> Also see 'man cygpath'.

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

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

- Raw text -


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