Library Linking

Discussion in 'Java' started by newbie, Jan 13, 2011.

  1. newbie

    newbie Guest

    I am trying to create a runnable jar file specfiication in eclipse.
    Could someone tell me the differences between:

    - Extract required libraries into generated jar
    - Package required libraries into generated jar
    - copy required libraries into a sub folder next to the generated jar

    I am just interested in having my packages together and adding some
    junit and selenium server files together and being able to create a
    jar that will allow me to click on my jar file run my code and start
    selenium up for my tests but do this outside eclipse.

    Andrew
    newbie, Jan 13, 2011
    #1
    1. Advertising

  2. newbie

    Lew Guest

    On 01/13/2011 12:49 AM, newbie wrote:
    > I am trying to create a runnable jar file specfiication in eclipse [sic].
    > Could someone tell me the differences between:
    >
    > - Extract required libraries into generated jar [sic]


    I don't call that "extract". You put required libraries into subdirectories
    with your JAR, not in your JAR.

    > - Package required libraries into generated jar [sic]


    Ditto.

    > - copy required libraries into a sub folder next to the generated jar


    Bingo!

    > I am just interested in having my packages together and adding some
    > junit [sic] and selenium [sic] server files together and being able to create a
    > jar [sic] that will allow me to click on my jar [sic] file run my code and start
    > selenium [sic] up for my tests but do this outside eclipse [sic].


    Put your JARs in the same directory, or put your libraries in a subdirectory
    under your main JAR. Fill in the main JAR manifest with the "Class-Path:"
    information, as documented in Oracle's web site. Package the main JAR and
    libraries as a ZIP file for distribution, unpack the ZIP at the target station
    for deployment. Associated "java -jar" with JAR files at the OS level. (Read
    up at the Oracle site on what the "-jar" option does.)

    --
    Lew
    Ceci n'est pas une pipe.
    Lew, Jan 13, 2011
    #2
    1. Advertising

  3. newbie

    Arne Vajhøj Guest

    On 13-01-2011 00:49, newbie wrote:
    > I am trying to create a runnable jar file specfiication in eclipse.
    > Could someone tell me the differences between:
    >
    > - Extract required libraries into generated jar


    I believe this mean that the class files in the required libraries
    will be extracted and added to the jar you are building.

    > - Package required libraries into generated jar


    I believe this mean that the required libraries
    will be added to the jar you are building in root.

    > - copy required libraries into a sub folder next to the generated jar


    This means that the required jar files will be copied to where
    the jar you are building is (in a subdirectory).

    > I am just interested in having my packages together and adding some
    > junit and selenium server files together and being able to create a
    > jar that will allow me to click on my jar file run my code and start
    > selenium up for my tests but do this outside eclipse.


    I will suggest the third option and a Class-Path directive
    in the manifest of the jar you are building.

    Arne
    Arne Vajhøj, Jan 14, 2011
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roland Raschke
    Replies:
    1
    Views:
    1,086
    Kevin Goodsell
    Sep 22, 2003
  2. Albert
    Replies:
    4
    Views:
    518
    Mike Wahler
    Sep 29, 2003
  3. Josep

    Dev-c++: Linking a library

    Josep, Mar 7, 2004, in forum: C++
    Replies:
    1
    Views:
    3,813
    John Harrison
    Mar 7, 2004
  4. Anthony Yio

    Linking to Static library of C

    Anthony Yio, May 20, 2004, in forum: C++
    Replies:
    1
    Views:
    354
    John Harrison
    May 20, 2004
  5. Thomas Ruschival

    C++/C-library linking (pslib)

    Thomas Ruschival, Nov 13, 2004, in forum: C++
    Replies:
    3
    Views:
    576
    Thomas Ruschival
    Nov 14, 2004
Loading...

Share This Page