exporting java app as jar which contains other libraries

34 views Asked by At

I have exported my simple java application as normal jar file which contains all the source file and the dependent libraries ie jar files. Here all the jars I have kept inside the lib folder of my application.

so these things I am able to do but when I am accessing my application as a jar file in other application then I am getting ClassNotFoundException because whatever libraries I have added inside the First application (which I have exported as jar contains all the dependent libraries) are not visible in runtime.

I think I need to give this information about the dependent libraries in MANIFEST.MF file of first application. but I don't know whether I am thinking right or wrong. I don't know how to write the MANIFEST.MF file and what would be the directory structure of the of my application if I want to keep the MANIFEST.MF file in my application.

Here for example I have created one jdbc application to create Connection object for that I had to add the ojdbc14.jar in the classpath of my application so for that I have created one lib folder inside the project root directory and I kept that ojdbc14.jar inside that lib folder and then I build the path. then I exported this application as simple jar which contains that ojdbc14.jar also then I added this jar in my other application but while running my second application I am getting ClassNotFoundException. Please Help Me On It.

0

There are 0 answers