Question

I'm having trouble running the jar command in cygwin. The input-files parameter isn't treating the directory I'm passing it recursively when I'm referencing it with ".."s in my path.

For example, I'm running this in the same directory as the "src" directory. src/ contains my package structure of class and java files. This runs properly and creates a jar containing my source and class files.

jar cf jarname.jar src

However when I run this next command, I get an empty jar except for a manifest file.

jar cf jarname.jar localdir/../src

I need to run this from a script that needs to find this directory with a ".." directory so I need the 2nd command to work.

Anybody know why this isn't working or have a workaround? I tried using realpath but it complains that it can't find that path at all. I may be using it wrong though.

Was it helpful?

Solution

The Directory path in cygwin is different . To navigate to any drive for example to C drive we need to type in:

/cygdrive/c

A very easy work around i found useful is just to type cmd in the terminal . This allows you to use the actual path than the cygwin specific path .

try typing cmd and then running the command , it worked for me

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top