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.

Similar Messages

  • How to include third party .jar files into my jar file

    Hi,
    how do i include a open source third party jar file into an executable jar?
    i have a class called BlogBox.java and it uses org.apache.commons.net.ftp.FTPClient, i want to create an executable file, where do i put the .jar file containing FTPClient aka Apache Commons Net?
    currently i'm getting the following error from when executing my BlogBox.jar
    C:\MyJava\BlogBox>java -jar BlogBox.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at blogbox.BlogBox.<init>(BlogBox.java:27)
    at blogbox.BlogBox.main(BlogBox.java:103)
    Any suggestions? i have searched google and this forum but could not find the solution to my problem, thanks
    [edited msg] do i need to add the classpath at execution or something of the apache commons net library?
    Message was edited by:
    gekkokid

    When you use an executable jar the normal class path
    is ignored, but you can put a classpath inside the
    jar. The usual trick is to place the library jar
    files in a directory inside the application directory
    and direct the manifest file to it. The manifest file
    live in the jar inside the META-INF directory and
    it's called manifest.mf
    The two heavilly used entries are Main-class: and
    Class-path: lines. Class-path just has a
    comma-separated list of library paths.
    The jar utility has a special option to load it up.Thanks :) I created a "/lib" directory, placed in the packages in there and redirected the Class-Path: lib/commons-net-1.4.1.jar
    and it works,
    thank you everyone :)

  • How to import multiple XML files into one inDesign document without copy/paste ?

    I use InDesign CS6, and I have several XML files with the same structure. Only the data are different.
    I created  an Indesign layout with some tagged placeholder frames on merge mode, for automated layout.
    Today for each XML file I have to create a new InDesign document to import the XML. Everything works fine. Then in order to have all Indesign layouts one after the other into a single Indesign layout, I have to use the copy/paste function.
    I mean for example, copy the contents of all documents to the first one. Or add pages of other documents to the first one, then delete spaces between each page.
    So my question is the following:
    How to repeat this process without copy/paste function, knowing that the
    number of XML files could be unknown.
    Thank you very much for your answer.

    Yes, effectively I would like to catalogue the files into one collection so i can save as one PDF and Print as one.:)
    I know I could save each AI as a pdf them then merge the pdf's together in acrobat, but I have nearly 100 files so would feel more comfortable seeing them all together before print / saving.
    My concern is that if I insert them in Ai, will the file resolution reduce? and will the ai still be editable and would it update the indesign file?
    Thanks for the quick reply

  • How do I combine pdf files into one pdf file?

    How do I combine a number of pdf files into one pdf file?

    If you want a more affordable option, you can try CreatePDF from Acrobat.com.

  • How to merge many XML files into one?

    Hi: I got a small project to combine many XML files into one and convert the combined XML file in Excel using AppleScript. My XML files look like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Metadataobject>
        <from>[email protected]</from>
        <jobname>B3_IM09MBDUF</jobname>
        <pages>2</pages>
        <priority>3</priority>
        <timezone>CEST</timezone>
        <year>2013</year>
        <month>7</month>
        <day>15</day>
        <hour>11</hour>
    </Metadataobject>
    and like this...
    <?xml version="1.0" encoding="UTF-8"?>
    <Metadataobject>
        <from>[email protected]</from>
        <jobname>P1_FR1330G006007_Kate_van der Vaart</jobname>
        <pages>2</pages>
        <priority>1</priority>
        <timezone>CEST</timezone>
        <year>2013</year>
        <month>7</month>
        <day>12</day>
        <hour>16</hour>
    </Metadataobject>
    I get many XML files like this. And I want them to be combined and shown like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Metadataobject>
        <job id="1">
        <from>[email protected]</from>
        <jobname>B3_IM09MBDUF</jobname>
        <pages>2</pages>
        <priority>3</priority>
        <timezone>CEST</timezone>
        <year>2013</year>
        <month>7</month>
        <day>15</day>
        <hour>11</hour>
        </job>
        <job id="1">
        <from>[email protected]</from>
        <jobname>P1_FR1330G006007_Kate_van der Vaart</jobname>
        <pages>2</pages>
        <priority>1</priority>
        <timezone>CEST</timezone>
        <year>2013</year>
        <month>7</month>
        <day>12</day>
        <hour>16</hour>
        </job>
    </Metadataobject>
    And finally the combined XML file converts in Excel sheet with column headings "Job ID", "From", "Job Name" and so on...
    Or there is another best way to get the same result...
    Thanks

    That is just an intermediary state to get to the excel version. Actually I get many small XML files (as shown above) from client and I want them all combined in an excel sheet with common column headings... like this...
    from
    jobname
      pages
    priority
    timezone
    year
    month
    day
    hour
    id
    [email protected]
    B3_IM09MBDUF
       2
    3
    CEST
    2013
    7
    15
    11
    1
    [email protected]
    B3_IM09MBDUF
       2
    3
    CEST
    2013
    7
    15
    11
    2
    Thanks for your response.

  • How to collect to different files into one message

    Hi,
    I have the following scenario:
    Two (5Mb) Files with different file structures each ->
    XI (transform and generate a single structure record) ->
    Insert a record in a DB for each new record generated
    Let suppose file1 has order headers - one order per line -and file2 has the corresponding order items - one item per line, e.g;
    File 1
    OrderNr  Description
    1        A
    2        B
    3        C
    File 2
    OrderNr   ItemNr   MaterialCode ....
    1         1        111
    1         2        222
    1         3        555
    2         1        888
    2         2        777
    3         1        111
    Imagine I want to insert a record in the database for
    each order/item like this
    OrderNr  ItemNr Description MaterialCode .....
    1        1      A           111
    1        2      A           222
    1        3      A           555
    My real scenario is a little more complicated but never mind for now.
    I need to collect the two different files with two different file structures into the same message. Although I have read about the subject I am not sure about how to do it using BPM because there isn't any field I could use to correlate file1 with file2 - I can only correlate a record of file1 with several records of file2. I simply know that the two files will be available in a specific directory once a day at 06:00AM.
    First question is:
    How can I collect the two messages originating each from a different file into only one message with two different subtypes one for each file structure?
    Because my background is ABAP I could do it with a workaround for temporarily storing the info from each file into database tables in XI and then correlate the info from the two files to generate a single message.
    Like this
    File1 -> XI -> INSERT DATA XI ZDB1 (via ABAP Proxy or RFC)
    File2 -> XI -> INSERT DATA XI ZDB2 (via ABAP Proxy or RFC)
    Them I could use an event to check when the two tables have all the data from both files. I could then combine the data from the two tables and start another integration process like this
    XI SERVER (ABAP Proxy) -> XI Integration Server -> Third-party (JDBC)
    But this way I would have to code the hole data conversion which is not a good idea from the perspective of XI (EAI/Broker).
    Maybe I sould use BPM. But how?
    Futhermore:
    Is BPM performant enough (we are talking about files with thousand of records)?
    Thanks in advance
    Diz

    Hi,
    for N:1 Multimapping you have to use BPM.
    After going through this weblog you will be quite familiar with how to collect 2 messages into one message.
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
    Steps:
    1. Create a abstract/ inbound / outbound interfaces. (in your case 3 /1/2).
    2. Perform 2:1 Multimapping.
    You can specify more than one message in either side.
    Just go to message tab in MM.
    3. Now follow the blog and you will get a output in the form of abstract interface.
    4. Define JDBC reciever Channel as usual.
    Your database will be updated.
    Just try this out.
    Regards
    Piyush

  • How to merge serveral layout files into one output file?

    Hi there!
    For my report, I need to get a datasheet with all the customer data from the database and I have to attach a second document - so I've created 2 files (rtf templates) within the layout section.
    But how can I now run my report and these files are merged to one?
    Thank you!
    BR
    Lena

    Hi Lena,
    Have you tried to combine the RTF templates into one template?
    You could use subtemplates or define the contents/logic from your second template into the main template by creating the template like:
    <?template:Template2?>
    your second template logic here
    <?end Template2?>
    And within the main template, you call this <?call@inlines:Template2?>
    Hope this helps.

  • Adobe Acrobat XI for mac, how to reverse pages in a pdf file and how to collate two pdf files into one

    I scanned some large documents, which were two sided. Because they were printed on glossy paper, I could not scan the pages double sided. So I made two files, one file containing all the even pages and one file containing all the odd pages. Now I have two problems: 1. the pages in the even pages file are in the reversed order, so I need to reverse the order of all the pages in this file. Then I need to combine these two files (collate) so that all the odd and even pages are combined into one single file and all the pages are in the correct order.
    In older acrobat pro programs (windows) I found a javascript file that could fix all this. However now I have Acrobat XI and I have a macbook pro, so now I'm completely lost. Can anyone help me with this problem?

    If you have a script that does it then you should use it... Open the console and run this command:
    app.getPath("app", "javascript");
    It will print out the location you need to use for the .js file you have. Then restart Acrobat and you should be good to go.

  • How do I combine pdf files into one?

    I am trying to combine pdf files into on big pdf file. I have an account and I am signed in but when I try to create a file the options do not pop up. Only option is to open a single file, not combine them.

    You are asking in the Adobe Reader user two user forum. Adobe Reader cannot combine PDF files. 
    You spoke of a "service".  The  forum for subscription services is  the acrobat.com forum. 
    Be well...

  • How do I combine PDF files into one, and reduce its file size?

    help asap

    Hey Rave and thank you for your answer,here is the deal.Im making magazine,and using acrobate adobe to convert all my files into PDF files.After that I need to merge all them files into 1 PDF file so I can upload it to site.And after doing all that - the file happens to be VERY LARGE 188MB when it has to be lower ,somewhere like 47MB or less then 100MB.And I dont seem to find the solution.So help

  • Using a Jar file into my jar project (Applet)

    Hy,
    I would like to know how I have to do to put a jar library in my jar file (containing my classes) ?
    I use only 2 classes of that particular jar library (Regex.class & RegRes.class), and when I only put the jar file (patbinfree153.jar), the applet stops when its reaches the first line where i use this class.
    this line :
    Regex Mon_Regex = new Regex("(([<][iI][mM][gG][^>]+)[sS][rR][cC][=][\"]{0,1}([^\"> ]*))");However, it works when I launch the applet in AppletViewer, but doesn't work anymore when I create a jar file, and open it through my web browser. (I signed already my jar file, and it works until it reaches this line). That it to say that the jvm can find the 2 external classes when I run the program trough Eclipse, but can't find them when I create my package .jar. (I hope I am clear)
    Do I need to extract the folders of this jar file ? Because I dont think the import works with those two classes. Or can I just put those 2 classes like my own classes, in this case, what to write for the import line ?
    the import I do :
    import com.stevesoft.pat.*;Thanks ^^

    I think I found a beginnig of solution, but I still have trouble.
    In the tutorial you gave me, it is said to add the following line in the manifest file to use jar in jar :
    Class-Path: JAR-FILE.jar(here is the source : http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html)
    I did it, it works fine locally, but when i put my html, jar, files on my web site, my applet seams not to find the other jar file again.
    Locally, the architecure is the following :
    \upload4.html
    \upload4.jar (its manifest have the class-path line linking with patbinfree153.jar)
    \patbinfree153.jar (contains 2 classes I need)I uploaded the same architecture on my web site, but it doesn't work. The applet stops when it reaches the 1st line where I need one of the patbinfree153 classes.
    Any idea ? :-)

  • How to assemble several PDF files into one PDF file

    Hi there,
    I have several PDF documents. How can I combine all these PDF documents in one unique PDF file?
    Thank you

    Yeah Preview is very limited indeed.
    It even gives you drag and drop capability, rotate individual pages and sequential numbering etc.
    Preview can do all of that.

  • How to merge two .mp4 files into one file?---Help!

    When two clients make viedo chats on FMS,FMS saves two clients' audio and video informations into two seperate mp4 files.
    Now I want to get one mp4 file which contaions one cilent's audio and video informations and another client's audio information when recording
    Is there any way to deal with this problem?
    Thanks in advance..

    Hi Tibor,
    Below is the output i got.
    [Tracer_2]<?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2015-04-05T23:22:05" EndDate="2015-04-03T11:10:27" StartDate="2015-04-03T11:10:27" Version="14.0 SP5 Patch 11 (Aug 27, 2014)">
        <Rowset>
            <Columns>
                <Column Description="" MaxRange="100" MinRange="0" Name="col1" SQLDataType="1" SourceColumn="col1"/>
                <Column Description="" MaxRange="100" MinRange="0" Name="col2" SQLDataType="1" SourceColumn="col2"/>
                <Column Description="" MaxRange="100" MinRange="0" Name="col3" SQLDataType="1" SourceColumn="col3"/>
            </Columns>
            <Row>
                <col1>1</col1>
                <col2>2</col2>
                <col3>3</col3>
            </Row>
            <Row>
                <col1>11</col1>
                <col2>22</col2>
                <col3>33</col3>
            </Row>
            <Row>
                <col1>a</col1>
                <col2>b</col2>
                <col3>c</col3>
            </Row>
        </Rowset>
    </Rowsets>
    Please find the image below to achieve this. Please note, I have used local variables to assign input xmls and repeat through it. Repeater_0 for Headers and Repeater_1 for body.
    Kindly ignore Doc_0 here, it's for another purpose. Document_1 is what we are focussing on.
    Please note, you would not be able to see columns as those are dynamically created. Still you can map it as shown above.
    Hope this helps.
    Best Regards,
    Swaroop

  • I want to combine pdf files.  How do I put seven files into one?

    I am trying to create a single file from 7 files... How do I do this?

    If you have Acrobat you would probably know. It costs about $449 and that would be hard to forget. You likely have the free Reader that cannot combine files.

  • How to add one poi jar file into webdynpro project

    Hi all:
        We would like to add one poi jar file into one webdynpro project, however, what should we do ?
        Its one external 3rd party jar file.

    Hi,
    To add a jar file you need to have an external library DC.
    Hope the below link will help you:
    [http://help.sap.com/saphelp_nw70/helpdata/en/46/3ce3e4df201d63e10000000a11466f/frameset.htm]
    thanks & regards,
    Manoj

Maybe you are looking for

  • Report:  rfbila00

    hello All, I am working on Report : rfbila00, balance sheet/profit lost statement. It is working fine. But in the output the percentage field is not getting populated. Can anyone tell me what may be the reson and what needs to be done. Thank You, Reg

  • CS4 3D problem

    Up until this week I was able to work with the 3d tools in CS4. But the past couple of days all I get is the SBOD, leading to a Force Quit whenever I try to do anything from the 3d menu (convert to postcard, load a 3d object, etc.). I've reset the pr

  • Confused about why LR 4.3 won't export jpgs

    Good evening, major frustration. I apparently cannot export some jpegs from my catalogs after about 4pm this afternoon. Win 7 64 bit-24gigs ram LR 4.3 exporting onto Local h LR 4.2 simply stopped at 12% exporting low res files to a local HD- rather t

  • How to pass out multiple rows from EJB method?

    I need a sample for passing multiple rows from a EJB query method (using SQLJ). All I found in existing sample code is query on a single row and pass out as a bean class e.g Emp class with some getXX() method. What I'm currently doing is to convert t

  • Finding Dependant Information

    Hi all, I want to display dependant name with thier parent name desc people_Details Pers_id,P_name,emp_number,sex,dob 101------ Rajeev -------------1101---------M----2-DEC-1970 102-------SumithaRajeev------------------F----10-Jun-1980 103----John----