OS independent path in build path

Discussion in 'Java' started by guesswho, Sep 6, 2006.

  1. guesswho

    guesswho Guest

    Hi,

    I hope someone can help... I'm quite new to java and eclipse and there
    is sth. i don't understand
    i want to add some external jar's (jawk, jclips) to my project, I
    placed them in my projects directory but when I add them to build path
    (in eclipse -> Add External JAR) it is impossible to give the OS
    independent path and i need to change that every time i want to run my
    app on different OS.
    ....so how to make external jars work on both Win/Linux ??

    thanks in advance,
    guesswho, Sep 6, 2006
    #1
    1. Advertising

  2. guesswho

    impaler Guest

    > (in eclipse -> Add External JAR) it is impossible to give the OS
    > independent path and i need to change that every time i want to run my
    > app on different OS.
    > ...so how to make external jars work on both Win/Linux ??
    >



    A good practice is to use a lib folder under your project dir and copy
    there all the dependencies. Don't use add external jars use Add Jar or
    Add Class Folder instead.
    Also have a look at ant and build your project including all the
    dependencies and you won't have problems at all in different OSs
    impaler, Sep 6, 2006
    #2
    1. Advertising

  3. guesswho

    Dale King Guest

    "impaler" <> wrote in message
    news:...
    >> (in eclipse -> Add External JAR) it is impossible to give the OS
    >> independent path and i need to change that every time i want to run my
    >> app on different OS.
    >> ...so how to make external jars work on both Win/Linux ??

    >
    > A good practice is to use a lib folder under your project dir and copy
    > there all the dependencies. Don't use add external jars use Add Jar or
    > Add Class Folder instead.
    > Also have a look at ant and build your project including all the
    > dependencies and you won't have problems at all in different OSs


    A better solution is to use Maven as your build environment. It will
    download and keep your external dependencies in its own repository. There is
    an Eclipse plug-in for it as well.

    --
    Dale King
    Dale King, Sep 6, 2006
    #3
  4. guesswho

    John O Guest

    guesswho wrote:
    > Hi,
    >
    > I hope someone can help... I'm quite new to java and eclipse and there
    > is sth. i don't understand
    > i want to add some external jar's (jawk, jclips) to my project, I
    > placed them in my projects directory but when I add them to build path
    > (in eclipse -> Add External JAR) it is impossible to give the OS
    > independent path and i need to change that every time i want to run my
    > app on different OS.
    > ...so how to make external jars work on both Win/Linux ??
    >
    > thanks in advance,
    >



    NetBeans 5.0 allows you to add libraries to your project. The build
    process (which uses ANT) places all library dependencies into a lib
    subdirectory next to the app's jar file. The jar file has pointers to
    all library dependencies...it has class-path entries for the other jar
    files. Works on all platforms.

    You should be able to do something similar with Eclipse.

    --
    John O'Conner
    John O, Sep 6, 2006
    #4
    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. MK
    Replies:
    1
    Views:
    837
    Peter Hansen
    Jun 25, 2003
  2. Steven Bethard
    Replies:
    3
    Views:
    322
    Scott David Daniels
    May 26, 2005
  3. erikj
    Replies:
    2
    Views:
    215
    erikj
    Dec 4, 2010
  4. PeterB
    Replies:
    1
    Views:
    135
    PeterB
    Feb 10, 2005
  5. MD
    Replies:
    1
    Views:
    109
    Michal Suchanek
    Apr 14, 2007
Loading...

Share This Page