Results 1 to 2 of 2
  1. #1
    BigBear is offline Member
    Join Date
    Jan 2010
    Posts
    37
    Rep Power
    0

    Default pack libraries into jar file

    Hi all, I made program, where I had to use third party libraries. When I compile and link the program, my 'application.jar' is made, but directory 'lib' with my libraries is copied into my application directory too. I'd like to generate just one application.jar file, which can include the libraries. How can I do it? Is that possible? (btw I'm developing in NetBeans).

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,762
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by BigBear View Post
    Hi all, I made program, where I had to use third party libraries. When I compile and link the program, my 'application.jar' is made, but directory 'lib' with my libraries is copied into my application directory too. I'd like to generate just one application.jar file, which can include the libraries. How can I do it? Is that possible? (btw I'm developing in NetBeans).
    If those libraries are binary executable files you can't store them in your .jar file because your operating system needs to load them as files. Inside your .jar file those libraries aren't really files, they're just entries in your .jar file. Installers (google for "IzPack") can install all sorts of files on a target system, not just a single .jar file. So let your NetBeans create your .jar file and let e.g. IzPack create an installable file that contains your .jar file as well as the other (binary) files.

    kind regards,

    Jos

Similar Threads

  1. Problem in importing jar file in libraries of netbeans
    By dataprofiling in forum AWT / Swing
    Replies: 1
    Last Post: 03-30-2010, 12:30 PM
  2. Get item from string array and pack with blank space
    By firewalll in forum New To Java
    Replies: 2
    Last Post: 09-02-2009, 08:38 AM
  3. Replies: 0
    Last Post: 03-26-2009, 05:07 PM
  4. Replies: 0
    Last Post: 09-30-2008, 11:06 AM
  5. visual web pack
    By Jack in forum NetBeans
    Replies: 2
    Last Post: 07-02-2007, 06:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •