• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to remove contents from .jar files

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
can anyone please say me how to remove files(contents) from .jar file?
For Example:
I have created a sample .jar file with

jar cf sample.jar A.class B.class etc

Now i want to remove all except A.class from sample.jar.

How could i do that?Thanks in Advance.

-Thanks & Regards,
Hamsa
 
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's one way. change the extension of your .jar to .zip. Unzip it and delete whatever file you want to. Again you can jar the left out file as you already did.
hope this help
 
Hamsagayathri Palanisamy
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by pranav bhatt:
Here's one way. change the extension of your .jar to .zip. Unzip it and delete whatever file you want to. Again you can jar the left out file as you already did.
hope this help





Thank you pranav, is there any commands to remove contents from .jar file?

-Thanks & Regards,
Hamsa
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since this is not related to SCJP, I'm going to move it to our General Computing forum.
 
reply
    Bookmark Topic Watch Topic
  • New Topic