Results 1 to 4 of 4
  1. #1
    blablabla is offline Member
    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    Default questions about external jars

    Hi,

    I am quite new to the interpreted languages, when you add an external jar and you make your project itself a jar will the external jar be embedded? Or do i have to put the external jar in the same place as my jar with a relative path to the external?

    I don't know if i am clear, can you help with this please?

    ps: i ask this question because i suspect it to be the source of a magic value error, dunno if it can be.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,798
    Rep Power
    19

    Default

    You have to supply the jar along with your jar.
    It doesn't get embedded, and Java can't pull jars that are in jars out anyway.
    So your deployment will consist of your jar and all the ones it uses as well.
    The MANIFEST in your jar file will provide the relative path to these dependencies.

    Normally you'd have something like:
    Java Code:
    distribution directory -> myjar.jar
                              lib -> all the other jars.

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,864
    Rep Power
    8

    Default

    It depends how you create the Jar. Are you doing this from the command line, from an IDE, what? Keep in mind that you can manually view the contents of a jar: Viewing the Contents of a JAR File (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)

    Edit- What Tolls said. Mostly I'm thinking of eclipse's option to extract a required Jar and repackage it into your own.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    blablabla is offline Member
    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    Default

    Ok get it ! I was doing it with eclipse export and everything seems to be there, it's nice to know anyway, thanks to you two.

Similar Threads

  1. Replies: 0
    Last Post: 11-03-2010, 02:16 PM
  2. Communication between two Jars
    By Gijava in forum Advanced Java
    Replies: 1
    Last Post: 06-26-2009, 04:59 PM
  3. Replies: 0
    Last Post: 08-19-2008, 04:44 PM
  4. Preblem with JARs
    By bizmut in forum Eclipse
    Replies: 1
    Last Post: 06-04-2008, 05:41 PM
  5. how to find unused jars??
    By orchid in forum Eclipse
    Replies: 4
    Last Post: 06-08-2007, 10:35 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
  •