• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

jar -C not working

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying this command:

 jar -cvf myNewFile.jar -C dir .

The message I received:

 dir/. : no such file or directory

However, it works without the -C option:

 jar -cvf myNewFile.jar .

I even replaced the 'dir' with the complete path with and without the '.' at the end. I also tried with and without the 'dir' itself. Also, I'm using a Mac.

Thanks in advance for your help!
 
Saloon Keeper
Posts: 12493
269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

The obvious question is, is there a dir folder inside your working directory?
 
Cosmid Constantine
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I'm confused about what the 'dir' represents here.

Assuming the full working directory is /Home/A/B

I even replaced 'dir' with the full path like this:

jar -cvf myNewFile.jar -C /Home/A/B .

And it's still not working. I typed the above command while at my current directory is /Home/A/B

I guess my question is what goes after the -C?

 
Stephan van Hulst
Saloon Keeper
Posts: 12493
269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your directory structure look like and what are you trying to do exactly?
 
Cosmid Constantine
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stephan,

Sorry for my late reply. Still trying to get use to this website.

After several tries, the command finally worked for me and produced the right result.

Thanks again for your help!




 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic