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

codeKitchens.jar from headFirstJava website

 
Frodo Boonyoung
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why I can't do
c:\> java -jar codeKitchens.jar
?

I got message:
Failed to load Main-Class manifest attribute from
codeKitchens.jar

How I can break that jar?

Thnx
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in windows use open with winzip
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jar tvf codeKitchens.jar will list the contents of the jar.
 
Frodo Boonyoung
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What the heck I can solve my noob proble expeditiously!!!

Thank you so much
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot run the JAR file because it wasn't created to do so. I suspect that it contains many separate examples and is not meant to be run as a single program. To run the individual examples, you can use

jar xvf codeKitchens.jar

to extract them first. Then you probably need to compile and run each one separately.

HTH

Layne
 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the codeKitchens.jar has the only one main class, you can add Main-Class: classname to the JAR file's manifest and run using java -jar codeKitchens.jar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic