I used following command to create my jar file- Client.jar " jar cvmf Config.txt Client.jar *.class lib image report" Where lib is a folder which contains many other jar files, image is a folder which contains image and report is folder containing jasper report files. Now my created jar file should have the following table of contents- (I ve just used an example of my directory structure) META-INF/MANIFEST.MF MyMainClass.class OtherClass.class lib/MyLib1.j ar lib/MyLib2.jar image/MyImage1.jpg image/MyImage2.jpg report/report1.jasper re port/report2.jasper
The content of my Config.txt file is- Main-Class: frmClientLogIn Created-By: Tanvir Class-Path: lib/MyLib1.jar lib/MyLib2.jar
Now in my application I used the following code to get an image- new utility().loadImage("./image/MyImage1.jpg" );
utility is a class which is in MyLib1.jar used to set a background picture of a frame and the picture is in image directory as u can see. But I m not getting any image,report or classes in other jar files.But If I just put the image,report and lib folder outside Client.jar file, I mean- Client.jar,lib,report and image in a directory, everything works well.How can I make a single jar putting my lib,image,report and other classes in a single jar file. One more thing,instead of- Class-Path: lib/MyLib1.jar lib/MyLib2.jar can I do this- Class-Path: lib/.jar* But I t didnt work for me.Do I have to mention each jar file in a folder. PLS HELP ME.