Adding jar files available in folder of a physical machine into server classpath by using MANIFEST.MF of war file
I have a doubt regarding adding a jar into server classpath. If a jar is required to be added, we will add in lib folder of war OR we will add the jar in server's lib folder.
But, I would like to add a jar available in a absolute folder in my machine say C:\test.jar into the classpath. Could this be possible.
I have tried adding the entry Class-path: C:/test.jar in the MANIFEST.MF of war file to do that and when war is deployed, I got classNotFoundException related to test.jar.
This means the jar test.jar is not added from MANIFEST.MF of war file into server classpath while deploying.
Am I missing something here OR is this not possible at all. Please note that the intention is to keep jar files in a separate folder in my machine and load the same in the server classpath by using MANIFEST.MF of war file. Kindly help me out.
In manifest.mf you can either have relative path or URL's. Try to convert your path to url as below,
But few suggestions, since you mentioned it is a webapp why not considering creating a shared library ?
Put in your manifest the class-path with this format (win):
and remember to put a new line at the end of the line
However every application server has a better method to share libraries, which one do you use?