public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Issue in Java path
@ 2019-09-24 10:39 Rakhi Batra - Assistant Manager Publication
  2019-09-24 12:04 ` [cygwin] " Jason Pyeron
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Rakhi Batra - Assistant Manager Publication @ 2019-09-24 10:39 UTC (permalink / raw)
  To: cygwin

Hello,
I am facing an issue in the path of the file. Whenever I am executing the
below command. The slashes in classpath are replaced with dots and I am
unable to navigate to files in order to run the scripts. Kindly guide why
this is happening and what is the solution. Thank you.

(java $JAVA_OPTS -classpath `cygpath -pu $CLASSPATH`
org.dspace.app.launcher.ScriptLauncher "$@")

-- 
Regards,

Rakhi

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

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

* RE: [cygwin] Issue in Java path
  2019-09-24 10:39 Issue in Java path Rakhi Batra - Assistant Manager Publication
@ 2019-09-24 12:04 ` Jason Pyeron
  2019-09-24 12:48 ` Eliot Moss
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Jason Pyeron @ 2019-09-24 12:04 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: Rakhi Batra - Assistant Manager Publication
> Sent: Tuesday, September 24, 2019 3:38 AM
> 
> Hello,
> I am facing an issue in the path of the file. Whenever I am executing the
> below command. The slashes in classpath are replaced with dots and I am

By dots, do you mean ":" ? Can you please provide a concrete example of the input and output?

> unable to navigate to files in order to run the scripts. Kindly guide why this is
> happening and what is the solution. Thank you.
> 
> (java $JAVA_OPTS -classpath `cygpath -pu $CLASSPATH`

This is a bad idea for at least 2 reasons.

1. the CLASSPATH variable has special meaning and the java executable will act on it if it exists - use $CP or anything else
2. you should "$(...)" not `...`

> org.dspace.app.launcher.ScriptLauncher "$@")
> 
> --
> Regards,
> 
> Rakhi
> 
> --
> 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



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

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

* Re: Issue in Java path
  2019-09-24 10:39 Issue in Java path Rakhi Batra - Assistant Manager Publication
  2019-09-24 12:04 ` [cygwin] " Jason Pyeron
@ 2019-09-24 12:48 ` Eliot Moss
  2019-09-24 12:50 ` Andrey Repin
  2019-09-24 23:08 ` Brian Inglis
  3 siblings, 0 replies; 6+ messages in thread
From: Eliot Moss @ 2019-09-24 12:48 UTC (permalink / raw)
  To: cygwin

On 9/24/2019 3:38 AM, Rakhi Batra - Assistant Manager Publication wrote:
> Hello,
> I am facing an issue in the path of the file. Whenever I am executing the
> below command. The slashes in classpath are replaced with dots and I am
> unable to navigate to files in order to run the scripts. Kindly guide why
> this is happening and what is the solution. Thank you.
> 
> (java $JAVA_OPTS -classpath `cygpath -pu $CLASSPATH`
> org.dspace.app.launcher.ScriptLauncher "$@")

Seeing as you did not supply specifics it's a little hard to know exactly
what's going on, but it is conceivable that you need to put $CLASSPATH
inside double quotes, i.e., if it has the Windows ; separator in it.  Also,
I discovered that if Windows drives are mentioned, such as C:, the next
character needs to be \, that is: C:\..., not (e.g.) C:a\b.

But turning \ or / into . would not have been done by cygpath.  That
would be done by Java.

But lastly I note that I am not aware of any version of Java built for
cygwin.  Java is a Windows program, so you'd be wanting something more
like:

java $JAVA_OPTS -classpath "$(cygpath -pw "$CLASSPATH")" ...

$(...) is the more modern version of ` `, which is now deprecated.
The " " around $( ) is to prevent the ; in the path from ending the
java command line as it is being processed by bash.

For a path that starts with drive letter C (say), start the path with
/cygdrive/c.

Regards - EM

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

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

* Re: Issue in Java path
  2019-09-24 10:39 Issue in Java path Rakhi Batra - Assistant Manager Publication
  2019-09-24 12:04 ` [cygwin] " Jason Pyeron
  2019-09-24 12:48 ` Eliot Moss
@ 2019-09-24 12:50 ` Andrey Repin
  2019-09-24 23:08 ` Brian Inglis
  3 siblings, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2019-09-24 12:50 UTC (permalink / raw)
  To: Rakhi Batra - Assistant Manager Publication, cygwin

Greetings, Rakhi Batra - Assistant Manager Publication!

> I am facing an issue in the path of the file. Whenever I am executing the
> below command. The slashes in classpath are replaced with dots and I am
> unable to navigate to files in order to run the scripts. Kindly guide why
> this is happening and what is the solution. Thank you.

> (java $JAVA_OPTS -classpath `cygpath -pu $CLASSPATH`
> org.dspace.app.launcher.ScriptLauncher "$@")

There's multiple issues beyond what has already been mentioned.
3. Missing quotation of an unknown variable.
4. There's no Cygwin Java, and using Cygwin paths with native Java is sure to
cause interoperability issues.


-- 
With best regards,
Andrey Repin
Tuesday, September 24, 2019 15:48:28

Sorry for my terrible english...


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

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

* Re: Issue in Java path
  2019-09-24 10:39 Issue in Java path Rakhi Batra - Assistant Manager Publication
                   ` (2 preceding siblings ...)
  2019-09-24 12:50 ` Andrey Repin
@ 2019-09-24 23:08 ` Brian Inglis
  2019-09-25 12:09   ` Rakhi Batra - Assistant Manager Publication
  3 siblings, 1 reply; 6+ messages in thread
From: Brian Inglis @ 2019-09-24 23:08 UTC (permalink / raw)
  To: cygwin

On 2019-09-24 01:38, Rakhi Batra - Assistant Manager Publication wrote:
> I am facing an issue in the path of the file. Whenever I am executing the
> below command. The slashes in classpath are replaced with dots and I am
> unable to navigate to files in order to run the scripts. Kindly guide why
> this is happening and what is the solution. Thank you.
> 
> (java $JAVA_OPTS -classpath `cygpath -pu $CLASSPATH`
> org.dspace.app.launcher.ScriptLauncher "$@")

There is no Cygwin Java, so please just define a Windows env var using Windows
paths and separators, do not explicitly specify it in the command line, and run
from a .cmd or .bat to avoid issues and bad assumptions:

set CLASSPATH=C:\Java\classes\lib.jar;C:\Java\classes\util.jar
java %JAVA_OPTS% org.dspace.app.launcher.ScriptLauncher %1 %2 %3 %4 %5 %6 %7 %8 %9

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

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

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

* Re: Issue in Java path
  2019-09-24 23:08 ` Brian Inglis
@ 2019-09-25 12:09   ` Rakhi Batra - Assistant Manager Publication
  0 siblings, 0 replies; 6+ messages in thread
From: Rakhi Batra - Assistant Manager Publication @ 2019-09-25 12:09 UTC (permalink / raw)
  To: cygwin

Thank you so much for the response.  It is working fine now. I just
replaced  `...` with this  "$(...)"


On Wed, Sep 25, 2019 at 4:05 AM Brian Inglis <
Brian.Inglis@systematicsw.ab.ca> wrote:

> On 2019-09-24 01:38, Rakhi Batra - Assistant Manager Publication wrote:
> > I am facing an issue in the path of the file. Whenever I am executing the
> > below command. The slashes in classpath are replaced with dots and I am
> > unable to navigate to files in order to run the scripts. Kindly guide why
> > this is happening and what is the solution. Thank you.
> >
> > (java $JAVA_OPTS -classpath `cygpath -pu $CLASSPATH`
> > org.dspace.app.launcher.ScriptLauncher "$@")
>
> There is no Cygwin Java, so please just define a Windows env var using
> Windows
> paths and separators, do not explicitly specify it in the command line,
> and run
> from a .cmd or .bat to avoid issues and bad assumptions:
>
> set CLASSPATH=C:\Java\classes\lib.jar;C:\Java\classes\util.jar
> java %JAVA_OPTS% org.dspace.app.launcher.ScriptLauncher %1 %2 %3 %4 %5 %6
> %7 %8 %9
>
> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
> This email may be disturbing to some readers as it contains
> too much technical detail. Reader discretion is advised.
>
> --
> 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
>
>

-- 
Regards,

Rakhi

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

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

end of thread, other threads:[~2019-09-25  5:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 10:39 Issue in Java path Rakhi Batra - Assistant Manager Publication
2019-09-24 12:04 ` [cygwin] " Jason Pyeron
2019-09-24 12:48 ` Eliot Moss
2019-09-24 12:50 ` Andrey Repin
2019-09-24 23:08 ` Brian Inglis
2019-09-25 12:09   ` Rakhi Batra - Assistant Manager Publication

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