Hey All, I have a simple soap client written using xfire. It has several jars that it references to other jars. I can run it fine when the directory structure is like this
Directory | +- start.bat | +- MyJarFile.jar | +- lib | +- All the referenced jar files
and i use the batch job to add all the jars in /lib to the classpath and it starts great.
My question is, can you add all the third party jars inside the jar file and have tell the manifest file that they are in there? I know you can do it with the jars outside your jar, but what is the syntax of the Class-Path: header in the manifest if the jar is inside the other jar? Well, first off, is this even possible?
Joined: Mar 11, 2005
Sorry, it looks like my dir structure diagram got messed up while posting.
Anyway, I have a dir, test, and in that dir i have a start.bat file, MyJarFile.jar, and a lib dir. In the lib dir are all the third part jars I am using.
Thanks, Sam [ May 01, 2007: Message edited by: sammaiah kyatham ]
Joined: Mar 11, 2005
First, thanks for the reply. However, I am not sure that you understood my question 100%. The way the you describe, works fine if the lib or resource directory is somewhere OUTSIDE the jar that I am trying to run. What I want to be able to do is package all the needed jars INSIDE one jar file and have the classpath reference the jars inside when trying to execute. I would like to be able to distribute one jar file and one start script and thats it. Is this possible, and if so how?
You could extract classes from all jar files to the same directory, and add your code to that same directory. Then you can jar that directory. Read the licenses of the other jar files carefully. You might not be allowed to de-assemble them, or redistribute their classes in another jar.
Still, I think it's better to leave the jars as they are, and distribute them with your application. That's how it's meant to be done: your code in your jars; libraries that you depend upon in their own jars.
Regards, Jan [ May 01, 2007: Message edited by: Jan Cumps ]