How to combine Jars or Include dependent Jars into One Jar

Hello,
I have build a small utility using few libraries now i want to make a bundle or jar of this utility. I don't want to let use includes the jars individuals. I want to make a single jar using all the jars so user needs to include only one jar.
So i need to include the dependent Jar files into a single jar.
I got few solutions using Google.
Like:
adding a Class-Path: myjar.jar to MANIFESTfile.
simply update the jar with jar using commnad jar uf main.jar myjar.jar_
but these are not working. when i use the Class-Path option the Tree of main jar looks like
main.jar
    <default-package>
         myjar.jar
    META-INF
         MANIFEST.MF
How can i combine the Jars into a single Jar? Please help.

It is to tell the JVM where to look for additional classesDoes it mean if i includes dependent jars to main jar and if i specify the path then JVM find that jars to specified pathThat's what 'telling the JVM where to look for additional classes' means, isn't it? I don't know what else it would mean.
and don't need to include it separately?You only have to specify the Class-path in the manifest, and run the JAR file with java -jar. In fact if you specify a classpath on the command line with java -jar it will be ignored.
All this is in the documentation.

Similar Messages

  • How to combine images from several different shoots into one

    Have LR 3.6 for Win xp.
    I have 4 differernt photo shoots that I want to combine into one big single catalogue.  I want to be able to rank and choose images from all 4 shoots at the same time so I can get the best ones identified.
    Each shoot is already in its separate catalogue but I cant figure out how to get all 4 shoots to show up at once so I can rank the best shots and maybe even make a collection of my best images from the 4 shoots.
    How might I do this??
    Thanks Suzzie

    My primary suggestion is that you watch the many videos by Julianne Kost provided in the Adobe site about organizing in the Library Module in LR 4, or read one of the many good LR books. If you want to venture on your own here's a very shorthand description of one of many ways to do what you want. Choose which Catalog you want to use. Open that Catalog and choose "Import from Another Catalog" under the File Menu in the Library Module. Select the images and import them to your chosen main catalog. Once all are in the same Catalog either Keyword all similar images you wish to compare, or make separate Collections of each one. Use the Compare function in the Library ("c" key) and eliminate the one you don't want. Unless you have one client viewing your images in LR and you don't want them to see that you have other images for other clients, I would suggest you use only a single catalog from here on out.

  • How to combine sql.Date with sql.Time into one?

    I have a database where I keep dates and times separately, and getting date only and time only out of a java.util.Date is no problem thanks to the classes java.sql.Date and java.sql.Time. However, I need to read these values back in, put them back together, and then do date comparisons with java.util.GregorianCalendar. I tried just adding the millisecond long values together but that didn't seem to work, and I've tried setting the year, month, date, hours, minutes and seconds individually into a GregorianCalendar but I haven't figured that out yet. Certain queries work out better keeping the date and time separate in the database and it takes less bytes than a timestamp, so please don't suggest I use a timestamp!
    Thanks for your help!
    Stephen

    You can add the milliseconds (ms), but you need to use just part of it. For this example, let X be one more than the maximum number of units in time and also the minimum number of units in date. If we were using hours instead of ms X would be 24.
    t = total ms from time
    d = total ms from date
    T = new combined time
    T = ((d / X) * X) + (T % X);Add (the date, rounded to the nearest day) and (the portion of time which is less than a day).

  • How to package other jar files into one jar?

    How to package other jar files into one jar? How can i get the class in the inner jar file?

    Generally not a good idea. The Java runtime won't be able to load classes from those "inner" jars, you'd have to write your own classloader to do that. It's not a brilliant idea, generally, anyway, since the point of having lots of jars is to keep your application modular. Bundling them all together like that means you have to re-deploy the whole thing to fix, for instance, one small bug in one small library
    If you really want to do this, there's an Eclipse plugin called FatJar, but I urge you to consider whether you really want to do it first.

  • How do I combine my three apple id's into one account, purchases?

    How do I combine my three apple id's into one account, purchases?
    These apple id's used different email accounts.
    I would like to close down the two other apple id's and use only my iCloud account.

    Content and Apple IDs -
    Content is forever tied to the Apple ID that bought it. Apple does not transfer content from one Apple ID to another. Apple does not merge Apple IDs. You will never be able to access your content bought with another Apple ID with a new Apple ID.
    The only way to get down to one Apple ID is to abandon content from the other two, or abandoning the idea of ever updating anything from the other two.

  • How do you combine two or more movie clips into one movie clip in iMovie '09

    how do you combine two or more movie clips into one movie clip in iMovie '09

    First create an iMovie project. Then drag the clips (or portions of clips) that you need into the project.
    When finished, use the SHARE menu to share the project.

  • How do I join multiple (short) audio clips into one single long audio clip in Premiere Pro CS5?

    Hello,
    The question is in the title but I'm wondering how I can join multiple (short) audio clips into one single long audio clip in PP CS5.5.  I put all my short clips right next to each other and selected all of them to see what options are available by right clicking and using the toolbar options at the top.  The closest that I got was to nest the sequence, but that's not what I really want.
    I'd like to merge all the short clips into one single (long) audio file to use under the video.
    Thoughts are welcome and  greatly appreciated.
    Thanks,
    -Melvin

    O.K. This is kind of fundamental and you will need to learn up on this fully ...but for now...
    Make sure you have the WAB ( work area bar )covering the length of the audio clips. ( You do not need to select them)
    Go to the File Menu> Export Media
    You will be given all the Export Options.  Choose Wave File
    Select option for Export Work Area.
    Choose where to export the file to ( HD location)
    follow your nose from there....
    http://tv.adobe.com/watch/learn-premiere-pro-cs5/exporting-with-adobe-media-encoder/
    BTW - Why are you taking the audio to Audition anyway? What are you going to do to it.

  • How do I consolidate all of my events into one big group of photos so I can see them all?

    The title says it all. How do I consolidate all of my events into one big group of photos so I can see them all? Instead a bunch of events.

    drag them together
    Or click on Photo in the source pane on the left and under the view menu uncheck show event titles
    LN

  • How do I put all my live feeds into one channel? I don't want to have to cick on each feed source separately.

    How do I put all my live feeds into one channel? I don't want to have to click on each feed source separately. Instead of one feed per website I want just ONE feed for all my sources together.

    Hi there old45,
    You may find the information in the article below helpful.
    iTunes 11 for Windows: Change where your iTunes files are stored
    http://support.apple.com/kb/PH12365
    Consolidate your files in the iTunes folder
    You can consolidate all the files in your library in the iTunes folder—for example, to make it easier to move your library to a new computer.
    Choose File > Library > Organize Library.
    Select “Consolidate files.”Files remain in their original locations, and copies are placed in the iTunes folder.
    To create folders (Music, Movies, TV Shows, Podcasts, Audiobooks, and so on) inside your iTunes folder, and place all your imported media files in the appropriate folders, select “Reorganize files in the folder ‘iTunes Media.’”
    Locate your iTunes files
    Do either of the following:
    Find out where a file is stored: Select the item in iTunes, and choose File > Get Info. The path to the file is shown at the bottom of the Summary pane (next to Where).
    Show the file in Windows Explorer: Select the song, and choose File > Show in Explorer.
    -Griff W.

  • HT204053 How do I join two Apple ID purchases into One?

    How do I join two Apple ID purchases into One?

    You can't, accounts can't be merged nor content transferred from one account to another account - content will remain tied to the account that downloaded it.

  • How do I put a group of tracks into one album

    How do I put a group of songs into one album?  They copied separately into iTunes.

    Generally, in iTunes, all you need to do is fill in an appropriate Album Artist to keep things together. For older iPods each track from the same album should have the same artist, or be marked as a compilation where appropriate. On iOS devices you may need to go to Settings > Music > Group By Album Artist > On. For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • I have 3 consecutive movie clips that I am trying to drop into the drop zone but it only recognizes the first one and only produces the firts one in a DVD. How can I drop all three  movie clips into one drop zone

    On IDVD, I have 3 consecutive movie clips that I am trying to drop into the drop zone to create a DVD but it only recognizes the first one I dropped and only produced the first one in a DVD. How can I drop all three  movie clips into one drop zone.

    I have had some luck doing the following: Export each clip from imovie as a quicktime clip. Open iDVD and create a new project. Import a few stills into iDVD and then click on the button that gets created to get into the screen where the individual slides appear. Drag each quicktime into that screen and arrange in the order you want. You can then delete the stills. The button that appeared when you dropped in the stills will launch a complete show.

  • Problem in include library files into my jar file

    i am new to this jar archiving...I have created a GUI with java swings..and i also use mysql driver to connect my database now i want to make an executable jar file for my GUI..with coonector i have done the following
    I have compiled my program and placed all the .java and .class files in
    c:\ java\ bin\ jarexample
    next i created a manifest file called mainClass.txt which contains
    Main-Class: AppletMain (where AppletMain is my mainclass).. I placed this txt file also in c:\ java\ bin\ jarexample
    i m also set Class-path in manifest file Class-Path: mysql-connector-java-3.1.10-bin.jar
    next i ran jar cmf mainClass.txt example.jar *.class mysql-connector-java-3.1.10-bin
    With this line, I told jar to create a JAR file (option c) with modifications to the manifest file (option m) as specified within mainClass.txt, naming the JAR file (option f) as example.jar and including everything that matches the pattern *Class and mysql connector
    now my problem is ...my MYSQL connection need some Library files from a package called org and class Driver.class to generate connection I include this library files also in my example.jar....
    But when i execute this jar file using :java -jar example.jar
    this is executed BCOZ tha example.jar file use mysql-connector-java-3.1.10-bin.jar file from system.
    If i m this mysql-connector-java-3.1.10-bin.jar file from system from system then it is not run.
    Can anyone please tell me how can i include this library file to my jar file( ie example.jar)
    Thankyou

    Double post. Please post replies on the other thread.
    http://forum.java.sun.com/thread.jspa?threadID=656781&tstart=0

  • How do I read the images I bundled into the jar file?

    I just wrote an applet that uses
         Toolkit tk = Toolkit.getDefaultToolkit();
         tk.getImage("blah.gif");to load a bunch of image files. The class file and gif images were bundled into a jar file to minimize the number of connections the browser has to make to the server.
    The applet works fine in appletviewer but trips a java.security.AccessControlException: access denied (java.io.FilePermission select.gif read) when run in a browser. I know you normally use Applet.getImage(URL) to load images but wont that circumvent the JAR file and make a seperate connection to the server for each image? That would defeat the purpose of using a JAR file.
    How do I access the image files I bundled into the JAR file?

    From your Applet class, write the following:
    URL imgUrl = getClass().getResource("blah.gif");
    Image img = getImage(imgUrl);The returned URL will be from the Applet class ClassLoader, which will look into the specified archive (jar) file.

  • How do I combine separate audio and video files into one Quicktime movie?

    I have DVDs that contain separate audio and video files in folders marked Audio_TS and Video_TS. I would like to know how to combine these files into a single Quicktime movie. Is there inexpensive or shareware software that imports and unites these files reliably? A simple solution is preferred, rather than getting into complex media editing applications.
    G4 eMac   Mac OS X (10.4.9)  

    Doug - the VOB files (in the VIDEO_TS folder) are MPEG-2 files. MPEG-2 have the video and audio mixed into the one file - there are no audio files to combine.
    The rest are directions to a DVD player (e.g. the BUP and IFO's) . The AUDIO_TS folder is used for DVD Audio discs and on video DVDs is always empty.
    Many people use Handbrake or iSquint to convert VOB to iPod video though MPEG Streamclip is the best - open the first numbered VOB and it will prompt you to open all of them. ALWAYS fix timecodes when it asks. You can then edit/trim and export to MPEG-4.

Maybe you are looking for

  • How to interrogate roles of a user in a process

    I mentioned this in the beta call on Wednesday, but I thought I would enter it here to follow-up on.... We have a business need to be able to interrogate the roles assigned to a user in our process flow. Here is an example: 1. A user enters some data

  • ODI Agent Test Start is Wrong

    Hi, I've been following John's excellant blog. I've created the master repository. In topology manager, I have created the connection, the dataserver, the work repository, the agent and context. I've updated odiparams.bat (http://john-goodwin.blogspo

  • Office:mac 2011

    I just bought an iMac and when I tried to open MS Word for the first time, it asked for a product key to activate online.  I understood this program to come with the computer, but I don't have the product key anywhere.  What solution do you suggest?

  • SAP HR: Cluster Key greater than 40 characters

    Hi All, I have a requirement where I need to store data in cluster PCL4 under a new RELID. The key length for this cluster data is coming out to be greater than 40 characters whereas the length of key field SRTFD is 40. Is there any way I can store d

  • How do you up grade to 75 Mbps if you have a lap top computer?

    I only have a lap top computer. How do I up grade to 75 Mbps? Thanks