I have created jar file for my project.
It is running successfully.
There is one ‘lib’ folder.
I have other jar files in this folder.
I added all these jar files in MANIFEST.MF in the jar as follows:
>>Class-Path:jar file names .... ... ....
I run jar file as follows:
>>java -jar jarfile.jar arguments...
but problem is that I need to put this jar file where the ‘lib’ folder is located,
and if i want to run this jar on others machine,then i need to give this jar folder along with ‘lib’ folder.
but I dont want to give this jar along with ‘lib’ folder.
And when I try to put this jar outside the ‘lib’ folder,it is not working.
I have to give this only jar folder to other machine.so I can run my jar file on others machine.
I’m sorry to tell you, but unless you implement your own custom class loader, you can not nest jar-files like that in Java. See for instance this discussion.
You could however merge your jar files using tools such as One-Jar.
Related answer.
(woho, this was my 1000th answer 🙂