Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: Wed, 25 Aug 2004 23:48:50 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Ramneek Singh cc: cygwin AT cygwin DOT com Subject: RE: Problem with Classpath for java thru perl script In-Reply-To: <000a01c48b1d$7afb52a0$9c7ba8c0@amer.cisco.com> Message-ID: References: <000a01c48b1d$7afb52a0$9c7ba8c0 AT amer DOT cisco DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 Ramneek, First off, . Thanks. To answer your questions: 1) I meant the latter if you invoke Java directly. If you use the wrapper scripts, you should use the POSIX paths -- the script will take care of the conversion. 2) I was thinking more of setting it from perl via %ENV before the java invocation. And yes, you should either use the forward slashes or escape the backslashes in this case. 3) No, Windows API functions understand forward slashes in paths just as readily as backslashes. HTH, Igor On Wed, 25 Aug 2004, Ramneek Singh wrote: > Igor, > Thanks for your response. > The java command is being executed by backtick operators `. > Questions: > 1)Can you please clarify the use of the forward slash(/) that you > Mentioned in one of your replies to my earlier email ? I am not > Sure if you mean that I convert it totally to a unix style or did > You mean C:/abc/def/myfile.jar ? > 2)I had set the CLASSPATH thru the Advanced Tab from ControlPanel -> > System. > Should the CLASSPATH be reset the same way with forward slash ? > > 3)Would the java program need to be recompiled using the new style of > Classpath ? > > Thanks! > > > -----Original Message----- > From: Igor Pechtchanski > Sent: Wednesday, August 25, 2004 3:58 PM > To: Ramneek Singh > Cc: cygwin AT XXXXXX DOT XXX > Subject: Re: Problem with Classpath for java thru perl script > > > On Wed, 25 Aug 2004, Ramneek Singh wrote: > > > Hi , > > > > I just installed cygwin on windows 2000. > > I need it to run a perl script which will execute a java command . > > Example: in the script it says thefollowing: > > > > java -classpath $CLASSPATH myprogram argument1 arg2 > > > > > > The problem is that though echo $CLASSPATH shows the correct classpath > > to the jar > > Files , example C:\abc\def\myfile.jar , when the perl script is run it > > complains: > > > > C:abcdefmyfile.jar not found > > > > Notice in above the \ was stripped. > > My java program is compiled with the C:\abc\def\myfiile.jar style of > > classpath. > > > > How can I get this to work ? > > You didn't say exactly how you're invoking the java process, so > depending > on what you do, there may be multiple solutions. If you use system(), > either quote the '\'s by using more '\'s (see the perl manpage) or set > CLASSPATH in the environment, or use a suitably modified version of the > java wrapper script that I posted to this list earlier (see > ). > Igor -- 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! "Happiness lies in being privileged to work hard for long hours in doing whatever you think is worth doing." -- Dr. Jubal Harshaw -- 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/