469,366 Members | 2,233 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

How to remove content from .jar files

184 100+
Hi,
can anyone please say me how to remove files 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
Mar 19 '08 #1
5 45403
r035198x
13,262 8TB
Hi,
can anyone please say me how to remove files 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
You have to extract and jar again.
Mar 19 '08 #2
sukatoa
539 512MB
Hi,
can anyone please say me how to remove files 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
Use WinRAR.... Open that jar file as WinRAR...
Edit the content...

And save it as .jar again....
Mar 19 '08 #3
JosAH
11,448 Expert 8TB
Hi,
can anyone please say me how to remove files 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
There is no command to delete file(s) from a .jar archive but there is hope: the .jar
file format is identical to the .zip file format. There are many .zip file handlers.

kind regards,

Jos

ps. this was a tip ;-)

edit: darn, too slow again ;-)
Mar 19 '08 #4
gaya3
184 100+
There is no command to delete file(s) from a .jar archive but there is hope: the .jar
file format is identical to the .zip file format. There are many .zip file handlers.

kind regards,

Jos

ps. this was a tip ;-)

edit: darn, too slow again ;-)

Thanks for all response..Thank u once again

-Thanks & Regards,
Hamsa
Mar 19 '08 #5
hello all jus use the followin command to delete files from jar

zip -d jarfilename classfilename.class

Thank
May 16 '12 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Aaron Fleming | last post: by
1 post views Thread by Nathan Bloomfield | last post: by
4 posts views Thread by Brian Henry | last post: by
1 post views Thread by Samuel R. Neff | last post: by
5 posts views Thread by DCDev | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.