delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/31/23:06:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Mon, 31 Oct 2005 23:06:02 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Siegfried Heintze <siegfried AT heintze DOT com>
cc: cygwin AT cygwin DOT com
Subject: RE: Wanted: Help translating classpath from CMD.EXE to bash
In-Reply-To: <15567636.1130803860651.JavaMail.SYSTEM@CCC-NOVA1>
Message-ID: <Pine.GSO.4.63.0510312128460.5226@slinky.cs.nyu.edu>
References: <15567636 DOT 1130803860651 DOT JavaMail DOT SYSTEM AT CCC-NOVA1>
MIME-Version: 1.0

On Mon, 31 Oct 2005, Siegfried Heintze wrote:

> Thanks Igor!
>
> > As someone mentioned, you can use "cygpath -p" to convert a POSIX-style
> > path into a Win32-style one.
>
> I think I need to go the other way. Given a CLASSPATH variable in
> windows, how do I convert it to cygwin? Do I use ":" to separate the
> elements, or do I use "\;". If I use ":", what about the windows device
> names?

I should've been clearer, and said "you can use 'cygpath -p' to convert
*between* a POSIX-style path and a Win32-style one".  "cygpath -[u]p" (the
"u" is optional) will convert from a Win32 path to a POSIX one, whereas
"cygpath -wp" will convert from a POSIX path to a Win32 one.  For more
details, see "man cygpath", as Larry said.

> It seems to me this should have worked, but it does not:
>  * CLASSPATH=.\;c:\\dev\\xalan\\xalan-j_2_7_0\\xsltcservlet.jar\;others
>  * export $CLASSPATH
>  * echo ${CLASSPATH}
>  * javac myprogram.java

What exactly didn't work here?  What were the errors?

> > Alternatively, you can try using my java wrapper scripts that will do
> > the translation automatically for you (the scripts can be found at
> > <http://cygwin.com/cgi-bin/cvsweb.cgi/wrappers/java/?cvsroot=cygwin-apps>;
> > you'll need to edit the scripts to point them to your Java
> > installation directory).
>
> OK, is there any documentation?

Nope.  I haven't really had time to package them properly.  I won't be
able to write full-fledged documentation, but I'm willing to answer
questions and accept documentation patches against the CVS repository
above.  Care to help out?

> What kind of wrappers are these?

They are wrappers around the "java", "javac", etc, executables.  Just make
sure they precede the real executables in the PATH.  They will basically
invoke the real ones, having translated the known path arguments to POSIX
format.  They will not translate all arguments -- if you pass filenames to
your Java program, you're responsible for translating those.  But they
help (a lot, actually -- I use them constantly on my machine).

> I have never heard of bash wrappers before. (hmmm... bash wrappers,
> sounds like a new genre of music! -- maybe something like slam dancing?)

They are wrapper programs written in bash.

> How about an example? That would probably suffice.

Sure.  You can run

/usr/local/bin/java -classpath /home/me/jars/a.jar:/home/me/classes SomeClass

And it'll call the Windows Java executable with the right paths.

> Well, even if I get Igor's bash wrappers to work, I'm kinda curious why
> my attempt did not.

You'll have to provide more details on what exactly didn't work in your
attempt.
HTH,
	Igor
P.S. If you decide to try XJ after all, I'd be interested in your feedback
off-list.
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

--
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