• 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
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Issue while packaging the class in the module

 
Ranch Hand
Posts: 112
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am trying to create jar file out of the module straight out of the Jeanne/Scott book page-461. But I am getting error. Please find the attached screenshot. What I am doing wrong?



issue1.PNG
[Thumbnail for issue1.PNG]
 
Greenhorn
Posts: 11
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Souvik,

I think it is because you are running the command from within the mods/ directory and your output jar file is mods/zoo.animal.feeding.jar (this is a relative path). Try specifyng jar -cvf zoo.animal.feeding.jar and it should work.

Nic  
 
Souvik Dasgupta
Ranch Hand
Posts: 112
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Nic, that worked. But now i am stuck with the page-464 problem and the module is not found. The example is exactly the same as book.

issue2.PNG
[Thumbnail for issue2.PNG]
 
Saloon Keeper
Posts: 11471
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once again, why are you inside the mods directory?
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jar -cfe jarDirectory/jarfileName.jar -C binDirectory/moduleName  .

c  = create
f  = fileName
e = main Class path
-C = where you create a jar file (Directory).
. = current Directory
 
On top of spaghetti all covered in cheese, there was this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!