• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Help on :: Programatically Creating Jar file From Existing Jar file

 
vijay kurhade
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create dummy jar file based on existing jar file; using java.util.Jar package classes like JarFile, JarOutputStream, Manifest class objects.


What I am tryig to do is

I have A.jar file
read A.jar; JarFile
get its manifest object with JarFile.getManifest()

manifest.put("READER", "MyName");

If i specify this manifest in
JarOutputStream(outputstream, manifest);

Get ZipException -> Duplicate META-INF\META-INF.MF entry



What is the best way to achieve creating copy of one jar to another with slight change to manifest file.


Help is Appreciated
 
Campbell Ritchie
Sheriff
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Easiest done from the command line, I would think. There should be something in the Java Tutorials; there is a section about modifying the manifest file.
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
intermediate level
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic