This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "Unable to access jarfile" when using full path of JAR


Dan Garrette wrote:
> I'm having a problem running JAR files in cygwin.
> 
> If I attempt to call a JAR file using its relative path, then it works fine:
> 
> But, if I attempt to call a JAR file using its full path, the file no
> longer seems visible:
> 
> $ pwd
> /usr/local/bin
> $ java -jar /usr/local/bin/malt-1.0.1/malt.jar
> Unable to access jarfile /usr/local/bin/malt-1.0.1/malt.jar

The java executable is not cygwin aware, so in both DOS and cygwin environments you need to use windows paths. You can use cygpath to do the translation if necessary.

$ java -jar `cygpath -m /usr/local/bin/malt-1.0.1/malt.jar`

> It works just fine in DOS:
> 
> D:\>java -jar c:\cygwin\usr\local\bin\malt-1.0.1\malt.jar
> <correct output>

As expected.

Dave.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]