aspose file tools*
The moose likes Beginning Java and the fly likes create jar problem: jarFile.jar: no such file or directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "create jar problem: jarFile.jar: no such file or directory" Watch "create jar problem: jarFile.jar: no such file or directory" New topic
Author

create jar problem: jarFile.jar: no such file or directory

Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Hi!

classes# jar c jarFile.jar *.class

jarFile.jar: no such file or directory

Could you help me create jar file?

Thank you!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/jar.html
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

Have you seen this?
Usage: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
Options:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-e specify application entry point for stand-alone application bundled into an executable jar file
-0 store only; use no ZIP compression
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following file

In your case, you want to create a new archive. So the option for that is "-c". You don't have "-c", you have "c".
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The "-" is optional.
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
jar -c test.jar *.class
and
jar c test.jar *.class

give the same error: test.jar : no such file or directory

Does someone know why it is happening? How can I fix it?
I'm using Ubuntu 9.10.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Did you look at the link I provided? It specifically states what you need along with the "c" parameter.
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
David Newton wrote:Did you look at the link I provided? It specifically states what you need along with the "c" parameter.

It was missing a "f".
jar cf test.jar files
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: create jar problem: jarFile.jar: no such file or directory