Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
 
Paul Clapham
Sheriff
Pie
Posts: 20750
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "-" is optional.
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look at the link I provided? It specifically states what you need along with the "c" parameter.
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic