wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes The Jarring Dilemma Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "The Jarring Dilemma" Watch "The Jarring Dilemma" New topic
Author

The Jarring Dilemma

Naresh Kumar Bhandari
Greenhorn

Joined: Jul 10, 2004
Posts: 1
A real stupid one.

I have heard there is a difference in the following two ways of using the jar command.

In dir "temp" with other subfolders like "misc1" and "misc2".
Each of these subfolders might have other subfolders and files within them.
Even files like ".somename".

- jar -cfmv new.jar META-INF/MANIFEST.MF .
- jar -cfmv new.jar META-INF/MANIFEST.MF *

Is there difference in the way these two commands create the new.jar.
I have tried it and find no difference. But, I have heard that there is a difference.

Thanks in advance.

Regards,
Naresh.


Life is ours, We live it our way.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Hi,

Welcome to JavaRanch!

The answer may actually be a little system-dependent. On UNIX systems, it's up to the command shell to interpret "*", whereas on Winders, it's up to the individual application (last I knew, anyway.) "." means the current directory, and that definitely could include .dotfiles in the current directory; but "*" means only visible files, so .dotfiles in the current directory would not be included.

In both cases, though, recursive handling of the contained directories would be the same. So on UNIX-like systems, anyway, there is a small difference: .dotfiles in the top level directory (only) may be included by ".", and omitted by "*".


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The Jarring Dilemma
 
Similar Threads
Can you store persistence.xml in an ear file?
.jar file in linux
Access Project Utility Jar which is outside of WebContent\WEB-INF\lib from web proj packaged as EAR
jar and MANIFEST.MF
What are ear,war and jar files ?