public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: bash, javac and that pesky slash.
@ 2000-01-24 12:40 Halim, Salman
  0 siblings, 0 replies; 13+ messages in thread
From: Halim, Salman @ 2000-01-24 12:40 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2491 bytes --]

java contains a File object which contains two static fields, one for path
separator and one for a directory separator.  on windows, they end up being
; and \. . .

perhaps this has something to do with the issue at hand?  (probably not; the
classpath is set and used elsewhere)  however, it would make sense for a
native application to be designed to work off the native settings.  cygwin's
settings aren't native to the windows environment :)

--
   =========================================================
   Salman Halim                 Technical Support           
                                                            
   Bluestone Software           Phone:  (856) 727-4600      
   1000 Briggs Rd.                                          
   Mt. Laurel, NJ 08054         Email:  salman@bluestone.com
   =========================================================
   Would you  care for a drink?   I mean, if it  were, like,
   disabled and you had to look after it?


> -----Original Message-----
> From: Andre Oliveira da Costa [ mailto:costa@cade.com.br ]
> Sent: Monday, January 24, 2000 2:53 PM
> To: cygwin@sourceware.cygnus.com
> Subject: RE: bash, javac and that pesky slash.
> 
> 
> > -----Original Message-----
> > From: cygwin-owner@sourceware.cygnus.com
> > [ mailto:cygwin-owner@sourceware.cygnus.com]On Behalf Of 
> David Robinow
> > Sent: Monday, January 24, 2000 5:03 PM
> > To: cygwin@sourceware.cygnus.com
> > Subject: RE: bash, javac and that pesky slash.
> [...]
> >  The "Therefore," above is incorrect.  There are
> > plenty of non-cygwin apps that recognize '/' as a path
> > seperator.
> 
> True. That was a (too) strong assumption. Thanks for pointing 
> that out.
> 
> [...]
> > > CLASSPATH environment variable
> > > must use M$-path-style also, because it is meant to
> > > be interpreted by jdk tools.
> >  Could be, I know nothing at all about java/jdk.
> 
> Believe me, it is: I recently installed jdk-1.2.2 on my NT4 
> machine, and
> Java tools refused to work from my bash prompt because I had CLASSPATH
> defined on my .bashrc with UNIX-like pathnames separated by 
> ":". When I
> changed it to M$-style paths and ";" among pathnames, it all worked.
> 
> Regards,
> 
> Andre
> --
> André Oliveira da Costa
> (costa@cade.com.br)
> 
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash, javac and that pesky slash.
  2000-01-24 18:17 Eric Feliu
@ 2000-01-25  9:20 ` Jeff Sturm
  0 siblings, 0 replies; 13+ messages in thread
From: Jeff Sturm @ 2000-01-25  9:20 UTC (permalink / raw)
  To: number6; +Cc: 'Craig MacFarlane', cygwin

Eric Feliu wrote:
> I use java and cygwin all the time, the thing you need to remember is that java for the
> windows environment was not written to use unix command line syntax. Your compile line
> should be :
> 
>           bash-2.02% javac -d "d:\destdir\classes" foo.java

An alternative is to write a "javac" shell script that converts the
CLASSPATH and arguments for you, then invokes the "real" javac.

That's what I did, so I would not have to convert dozens of Makefiles. 
I can also use either javac.exe or Microsoft's jvc.exe for compiling
without changing a single line in my project.

-- 
Jeff Sturm
jsturm@sigma6.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash, javac and that pesky slash.
@ 2000-01-24 18:17 Eric Feliu
  2000-01-25  9:20 ` Jeff Sturm
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Feliu @ 2000-01-24 18:17 UTC (permalink / raw)
  To: 'Craig MacFarlane', cygwin

I use java and cygwin all the time, the thing you need to remember is that java for the
windows environment was not written to use unix command line syntax. Your compile line 
should be :

	  bash-2.02% javac -d "d:\destdir\classes" foo.java

Like Chris Faylor stated this is really a limitation of the javac compiler and not Cygwin.

Eric

	

-----Original Message-----
From:	Craig MacFarlane [SMTP:craigm@chemconnect.com]
Sent:	Monday, January 24, 2000 12:32 PM
To:	cygwin@sourceware.cygnus.com
Subject:	bash, javac and that pesky slash.


Sun's javac, in jdk1.2.1, seems to change the
forward slashes used by bash to backward slashes
used by windows.

e.g.

  bash-2.02% javac -d //d/destdir/classes foo.java

produces the error message

  The \\d\destdir\classes directory does not exist.

Is there any way to use javac with bash
while specifying destination dirs for your classes?
It appears as though javac is trying to be too smart
by substituting slashes.

Thanks,
Craig

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash, javac and that pesky slash.
@ 2000-01-24 16:05 Paul Johnston
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Johnston @ 2000-01-24 16:05 UTC (permalink / raw)
  To: cygwin

Strange, I'm using cygwin with jdk1.2.2/1.2.1/1.1.8 and have been happily
backslash-free on my NT box.  Javac understands normal unix-style path
separators for me...

$ javac -d /home/me/lib/java Foo.java Bar.java

why the 2 leading solidii in your -d example?

Paul

-----Original Message-----
From: Craig MacFarlane <craigm@chemconnect.com>
To: cygwin@sourceware.cygnus.com <cygwin@sourceware.cygnus.com>
Date: Monday, January 24, 2000 9:32 AM
Subject: bash, javac and that pesky slash.


>
>Sun's javac, in jdk1.2.1, seems to change the
>forward slashes used by bash to backward slashes
>used by windows.
>
>e.g.
>
>  bash-2.02% javac -d //d/destdir/classes foo.java
>
>produces the error message
>
>  The \\d\destdir\classes directory does not exist.
>
>Is there any way to use javac with bash
>while specifying destination dirs for your classes?
>It appears as though javac is trying to be too smart
>by substituting slashes.
>
>Thanks,
>Craig
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe@sourceware.cygnus.com
>
>


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash, javac and that pesky slash.
  2000-01-24 11:03 David Robinow
@ 2000-01-24 11:53 ` Andre Oliveira da Costa
  0 siblings, 0 replies; 13+ messages in thread
From: Andre Oliveira da Costa @ 2000-01-24 11:53 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]

> -----Original Message-----
> From: cygwin-owner@sourceware.cygnus.com
> [ mailto:cygwin-owner@sourceware.cygnus.com]On Behalf Of David Robinow
> Sent: Monday, January 24, 2000 5:03 PM
> To: cygwin@sourceware.cygnus.com
> Subject: RE: bash, javac and that pesky slash.
[...]
>  The "Therefore," above is incorrect.  There are
> plenty of non-cygwin apps that recognize '/' as a path
> seperator.

True. That was a (too) strong assumption. Thanks for pointing that out.

[...]
> > CLASSPATH environment variable
> > must use M$-path-style also, because it is meant to
> > be interpreted by jdk tools.
>  Could be, I know nothing at all about java/jdk.

Believe me, it is: I recently installed jdk-1.2.2 on my NT4 machine, and
Java tools refused to work from my bash prompt because I had CLASSPATH
defined on my .bashrc with UNIX-like pathnames separated by ":". When I
changed it to M$-style paths and ";" among pathnames, it all worked.

Regards,

Andre
--
André Oliveira da Costa
(costa@cade.com.br)


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash, javac and that pesky slash.
  2000-01-24  9:32 Craig MacFarlane
  2000-01-24  9:39 ` Randall R Schulz
  2000-01-24  9:41 ` Chris Faylor
@ 2000-01-24 11:36 ` Kazuhiro Fujieda
  2 siblings, 0 replies; 13+ messages in thread
From: Kazuhiro Fujieda @ 2000-01-24 11:36 UTC (permalink / raw)
  To: cygwin

>>> On Mon, 24 Jan 2000 09:31:30 -0800
>>> Craig MacFarlane <craigm@chemconnect.com> said:

> Sun's javac, in jdk1.2.1, seems to change the
> forward slashes used by bash to backward slashes
> used by windows.
> 
> e.g.
> 
>   bash-2.02% javac -d //d/destdir/classes foo.java
> 
> produces the error message
> 
>   The \\d\destdir\classes directory does not exist.

You can use a shell script like the following.

#!/bin/sh

params="/jdk1.2.2/bin/`basename '$0'`"
while [ $# -gt 0 ]
do
    if expr "$1" : '-.*' >/dev/null 2>&1
    then
	arg="$1"
    else
	arg=`cygpath -p -w "$1"`
    fi
    params="$params '$arg'"
    shift
done
eval "$params"

____
  | AIST      Kazuhiro Fujieda <fujieda@jaist.ac.jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash, javac and that pesky slash.
@ 2000-01-24 11:03 David Robinow
  2000-01-24 11:53 ` Andre Oliveira da Costa
  0 siblings, 1 reply; 13+ messages in thread
From: David Robinow @ 2000-01-24 11:03 UTC (permalink / raw)
  To: cygwin

--- Andre Oliveira da Costa <costa@cade.com.br> wrote:
> That's true. jdk is a Windows native application, it
> wasn't compiled with
> cygwin. Therefore, it doesn't understand the '/'
> used by UNIX (cygwin); you
> must use the M$ '\'.
 The "Therefore," above is incorrect.  There are
plenty of non-cygwin apps that recognize '/' as a path
seperator.
>       Also, drives must be referenced
> by their "names" (e.g.
> "D:" in your case, and not "//d"). Other: the
 This part is true.
> CLASSPATH environment variable
> must use M$-path-style also, because it is meant to
> be interpreted by jdk tools.
 Could be, I know nothing at all about java/jdk.


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash, javac and that pesky slash.
  2000-01-24  9:41   ` Chris Faylor
@ 2000-01-24  9:55     ` Randall R Schulz
  0 siblings, 0 replies; 13+ messages in thread
From: Randall R Schulz @ 2000-01-24  9:55 UTC (permalink / raw)
  To: cygwin

D'Oh!

Javac, too?

R


>On Mon, Jan 24, 2000 at 09:39:12AM -0800, Randall R Schulz wrote:
>  >You must distinguish Cygwin programs from all others and use Windows
>  >native path name syntax for any program not compiled for Cygwin. For
>  >me, this most often manifests itself when I wish to launch Vim.
>
>Of course, you can always get a cygwin version of vim and then you
>wouldn't have this problem.
>
>Check out the cygwin web page for pointers to all sorts of ported
>software.
>
>cgf



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: bash, javac and that pesky slash.
  2000-01-24  9:39 ` Randall R Schulz
  2000-01-24  9:41   ` Chris Faylor
@ 2000-01-24  9:49   ` Andre Oliveira da Costa
  1 sibling, 0 replies; 13+ messages in thread
From: Andre Oliveira da Costa @ 2000-01-24  9:49 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

That's true. jdk is a Windows native application, it wasn't compiled with
cygwin. Therefore, it doesn't understand the '/' used by UNIX (cygwin); you
must use the M$ '\'. Also, drives must be referenced by their "names" (e.g.
"D:" in your case, and not "//d"). Other: the CLASSPATH environment variable
must use M$-path-style also, because it is meant to be interpreted by jdk
tools.

HTH.

Regards,

Andre
--
André Oliveira da Costa
(costa@cade.com.br)

> -----Original Message-----
> From: cygwin-owner@sourceware.cygnus.com
> [ mailto:cygwin-owner@sourceware.cygnus.com]On Behalf Of Randall R Schulz
> Sent: Monday, January 24, 2000 3:39 PM
> To: Craig MacFarlane; cygwin@sourceware.cygnus.com
> Subject: Re: bash, javac and that pesky slash.
>
>
> Craig,
>
> You must distinguish Cygwin programs from all others and use Windows
> native path name syntax for any program not compiled for Cygwin. For
> me, this most often manifests itself when I wish to launch Vim.


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash, javac and that pesky slash.
  2000-01-24  9:32 Craig MacFarlane
  2000-01-24  9:39 ` Randall R Schulz
@ 2000-01-24  9:41 ` Chris Faylor
  2000-01-24 11:36 ` Kazuhiro Fujieda
  2 siblings, 0 replies; 13+ messages in thread
From: Chris Faylor @ 2000-01-24  9:41 UTC (permalink / raw)
  To: Craig MacFarlane; +Cc: cygwin

On Mon, Jan 24, 2000 at 09:31:30AM -0800, Craig MacFarlane wrote:
>Sun's javac, in jdk1.2.1, seems to change the forward slashes used by
>bash to backward slashes used by windows.
>
>e.g.
>
>bash-2.02% javac -d //d/destdir/classes foo.java
>
>produces the error message
>
>The \\d\destdir\classes directory does not exist.
>
>Is there any way to use javac with bash while specifying destination
>dirs for your classes?  It appears as though javac is trying to be too
>smart by substituting slashes.

Is there some reason why you're asking this question here rather than
in, say a Sun javac mailing list?

FYI, even if you could do something magical to javac to cause it
to emit forward slashes, it still would not understand the //d
drive syntax since this is cygwin specific.  For an application
to understand cygwin drive specs, it would need to be linked with
the cygwin DLL.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash, javac and that pesky slash.
  2000-01-24  9:39 ` Randall R Schulz
@ 2000-01-24  9:41   ` Chris Faylor
  2000-01-24  9:55     ` Randall R Schulz
  2000-01-24  9:49   ` Andre Oliveira da Costa
  1 sibling, 1 reply; 13+ messages in thread
From: Chris Faylor @ 2000-01-24  9:41 UTC (permalink / raw)
  To: Randall R Schulz; +Cc: Craig MacFarlane, cygwin

On Mon, Jan 24, 2000 at 09:39:12AM -0800, Randall R Schulz wrote:
>You must distinguish Cygwin programs from all others and use Windows 
>native path name syntax for any program not compiled for Cygwin. For 
>me, this most often manifests itself when I wish to launch Vim.

Of course, you can always get a cygwin version of vim and then you
wouldn't have this problem.

Check out the cygwin web page for pointers to all sorts of ported
software.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: bash, javac and that pesky slash.
  2000-01-24  9:32 Craig MacFarlane
@ 2000-01-24  9:39 ` Randall R Schulz
  2000-01-24  9:41   ` Chris Faylor
  2000-01-24  9:49   ` Andre Oliveira da Costa
  2000-01-24  9:41 ` Chris Faylor
  2000-01-24 11:36 ` Kazuhiro Fujieda
  2 siblings, 2 replies; 13+ messages in thread
From: Randall R Schulz @ 2000-01-24  9:39 UTC (permalink / raw)
  To: Craig MacFarlane, cygwin

Craig,

You must distinguish Cygwin programs from all others and use Windows 
native path name syntax for any program not compiled for Cygwin. For 
me, this most often manifests itself when I wish to launch Vim.

Randy Schulz
Teknowledge Corp.
Palo Alto, CA USA


At 09:31 -0800 1/24/00, Craig MacFarlane wrote:
>Sun's javac, in jdk1.2.1, seems to change the
>forward slashes used by bash to backward slashes
>used by windows.
>
>e.g.
>
>   bash-2.02% javac -d //d/destdir/classes foo.java
>
>produces the error message
>
>   The \\d\destdir\classes directory does not exist.
>
>Is there any way to use javac with bash
>while specifying destination dirs for your classes?
>It appears as though javac is trying to be too smart
>by substituting slashes.
>
>Thanks,
>Craig



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bash, javac and that pesky slash.
@ 2000-01-24  9:32 Craig MacFarlane
  2000-01-24  9:39 ` Randall R Schulz
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Craig MacFarlane @ 2000-01-24  9:32 UTC (permalink / raw)
  To: cygwin

Sun's javac, in jdk1.2.1, seems to change the
forward slashes used by bash to backward slashes
used by windows.

e.g.

  bash-2.02% javac -d //d/destdir/classes foo.java

produces the error message

  The \\d\destdir\classes directory does not exist.

Is there any way to use javac with bash
while specifying destination dirs for your classes?
It appears as though javac is trying to be too smart
by substituting slashes.

Thanks,
Craig

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2000-01-25  9:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-24 12:40 bash, javac and that pesky slash Halim, Salman
  -- strict thread matches above, loose matches on Subject: below --
2000-01-24 18:17 Eric Feliu
2000-01-25  9:20 ` Jeff Sturm
2000-01-24 16:05 Paul Johnston
2000-01-24 11:03 David Robinow
2000-01-24 11:53 ` Andre Oliveira da Costa
2000-01-24  9:32 Craig MacFarlane
2000-01-24  9:39 ` Randall R Schulz
2000-01-24  9:41   ` Chris Faylor
2000-01-24  9:55     ` Randall R Schulz
2000-01-24  9:49   ` Andre Oliveira da Costa
2000-01-24  9:41 ` Chris Faylor
2000-01-24 11:36 ` Kazuhiro Fujieda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).