Re: handling external jars

From: Georg von Bülow (geor..oleque.com.br)
Date: Mon Oct 23 2006 - 12:46:54 EDT

  • Next message: ap..indesay.co.nz: "Ant Tasks"

    To group externals jars in Eclipse, you could also create your own User
    Libraries.

    In Java Build Path / Libraries, choose Add Library..., then User Library.
    Like this you can compose your own Libraries from external jars, and
    give them a name ("MyLibrary").

    In your projects then only the symbol of the Library appears, and you
    won´t always see all the included jars listed up.
    Only when you open the Library it shows the containing jars (just like
    the "WebObjects Frameworks" Library).
    And you could reuse your Library in other projects as well as a fixed
    set of jars.

    HTH,
    Georg

    > On 10/23/06, Patrick Robinson <pg..t.edu> wrote:
    >> I assume the normal way to handle external jar files in a WO project
    >> is to wrap them in a WO framework? Is that correct? It seems to
    >> work fine if these WO frameworks are then installed in the normal
    >> place (e.g. /Library/Frameworks on MacOSX). If I do this, then
    >> UNIXClassPath.txt is generated correctly (using LOCALROOT/Library/
    >> Frameworks as the location for the framework).
    >
    > I don't know what the normal way is. When I've just needed a few jar
    > files for a single project, I have created a lib folder in my project,
    > put the jars in there, added them to the WOLips classpath using the
    > Add Jars button, and then modified the build.xml so it looks like
    > this:
    > <lib dir="./lib">
    > <include name="Add .jar's that should be copied in the
    > woa."/>
    > <include name="*.jar"/>
    > <exclude name="**/*.woa/**"/>
    > </lib>
    >
    > For jars that I share between many projects, I create a Framework.
    >
    >> It may not be a very big deal, but I did notice that if the
    >> referenced WO framework lives in {User Home}/Library/Frameworks, then
    >> the generated UNIXClassPath.txt does not include it.
    >
    > I know that in the WO Classpath Container there is a section for
    > frameworks in {User Home}. If that's not working, you may need to
    > check your ~/wobuild.properties. I've never used it, so I don't know
    > if it actually works or not.
    >
    >> But how do you handle jars from the WebObjects Extensions directory?
    >> How do you tell Eclipse that's where they are, so the compiler finds
    >> them? I tried adding them to the Java Build Path as external jars,
    >> and that seems to work
    >
    > The jars from the WebObjects Extensions directory should get added to
    > your runtime path automatically. I've only ever used JDBC jars in my
    > Extensions dir, so I had not previously noticed that they don't seem
    > to get added to the build path. Not sure how the WOLips folks intend
    > for this to happen by default with the build path.
    >
    >> (although I don't particularly like how
    >> they're all listed at the "project root" level in the Package
    >> Explorer view... can anything be done to organize them?). Is this
    >> the typical way to deal with these?
    >
    > Eclipse puts all jars on your build path at the root of the project in
    > the Package Explorer view. You can either use the filter option of the
    > Package Explorer view to change this (small downward triangle at the
    > far right of the toolbar) or use a Framework, which nests them under
    > the WO Classpath Container. You could probably write your own
    > classpath container as well, but that seems like serious overkill.
    >
    > HTH,
    > Logan
    >

    -- 
    \o/ Georg von Bülow, Moleque de Idéias Educação e Tecnologia Ltda
      |  Phone: 55-21-2710-0178 E-mail: geor..oleque.com.br
    / \ http://www.moleque.com.br   Niterói - Rio de Janeiro - Brasil
    



    This archive was generated by hypermail 2.0.0 : Mon Oct 23 2006 - 13:45:40 EDT