Results 1 to 4 of 4
  1. #1
    chrvi is offline Member
    Join Date
    Jul 2008
    Posts
    1
    Rep Power
    0

    Unhappy How to make Apache Commons (StringUtils etc...) work with Eclipse?

    Hello,

    I downloaded Apache Commons Lang (commons-lang-2.4-bin.zip) to be able to use StringUtils and such stuff.
    I don't, however, know how to make it work in Eclipse.
    I would just like to use its methods from other Eclipse projects of mine...

    Is there an easy way how to use/add/install such components in Eclipse?

    The extracted zip file contains three jar files so (as it can be seen in the attached picture) I created a new Eclipse project "commons" and in its properties (Java Build Path / Libraries) I added all the three jars.

    Nevertheless, I still can't use any of the org.apache.commons.lang methods in my projects since org.apache cannot be resolved.
    I did edit my projects properties (Java Build Path / Projects) so that thay contain the newly created "commons" project but it didn't help.

    Any hint?


    And still I'm confused that I can't see any java files in the new "commons" project although the commons-lang-2.4-sources.jar actually does contain java files...

    Thanks in advance.
    Attached Thumbnails Attached Thumbnails How to make Apache Commons (StringUtils etc...) work with Eclipse?-eclipse-projects-lq.jpg  
    Last edited by chrvi; 07-31-2008 at 05:21 PM.

  2. #2
    Mihai Cazac is offline Member
    Join Date
    Apr 2009
    Posts
    1
    Rep Power
    0

    Default

    Download commons-lang-2.4.zip from Apache Commons - Lang Downloads
    Expand the archive in a directory (eg. H:\devel\commons-lang-2.4)
    In eclipse:
    A Put the library in the java build path

    Window -> Preferences: Java - Build path - User Libraries push the "New..." button, and in the "User library name:" enter 'appache-commons-lang'.
    Click to select "appache-commons-lang" in the "Defined user libraries" list and then click on the "Add JARs..." button and browse for commons-lang-2.4.jar (in the folder you've saved earlier) and select it.
    Now in the "Defined user libraries", under commons-lang-2.4.jar you have to have "Source attachment" and "Javadoc location" ; for each of them, select it, then push "Edit..." , then "External file" and browse for the corresponding jar (/commons-lang-2.4-sources.jar and commons-lang-2.4-sources.jar

    B. In your project add this user library
    In the Package Explorer right-click on the project name, go to Properties, and select the Libraries tab; click the "Add Library..." button, from the list select "User library" , "Next", mark [x] appache-commons-lang, and click "Finish"
    Attached Thumbnails Attached Thumbnails How to make Apache Commons (StringUtils etc...) work with Eclipse?-apache-common-mic.jpg   How to make Apache Commons (StringUtils etc...) work with Eclipse?-apache-common-project.jpg  

  3. #3
    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    0

    Default Thanks

    Thanks for the tip. Very helpful. Worked perfectly. :)

  4. #4
    java1's Avatar
    java1 is offline Member
    Join Date
    Mar 2011
    Location
    USA
    Posts
    9
    Rep Power
    0

    Default Re: How to make Apache Commons (StringUtils etc...) work with Eclipse?

    Quote Originally Posted by Mihai Cazac View Post
    Download commons-lang-2.4.zip from Apache Commons - Lang Downloads
    Expand the archive in a directory (eg. H:\devel\commons-lang-2.4)
    In eclipse:
    A Put the library in the java build path

    Window -> Preferences: Java - Build path - User Libraries push the "New..." button, and in the "User library name:" enter 'appache-commons-lang'.
    Click to select "appache-commons-lang" in the "Defined user libraries" list and then click on the "Add JARs..." button and browse for commons-lang-2.4.jar (in the folder you've saved earlier) and select it.
    Now in the "Defined user libraries", under commons-lang-2.4.jar you have to have "Source attachment" and "Javadoc location" ; for each of them, select it, then push "Edit..." , then "External file" and browse for the corresponding jar (/commons-lang-2.4-sources.jar and commons-lang-2.4-sources.jar

    B. In your project add this user library
    In the Package Explorer right-click on the project name, go to Properties, and select the Libraries tab; click the "Add Library..." button, from the list select "User library" , "Next", mark [x] appache-commons-lang, and click "Finish"
    it works fine ..thanks for nice post

Similar Threads

  1. Replies: 3
    Last Post: 07-25-2011, 04:19 PM
  2. Work on Struts with Eclipse, how?
    By Unni in forum Eclipse
    Replies: 2
    Last Post: 11-17-2008, 07:13 AM
  3. Can't make JTable work -- please help!!
    By cagalli83 in forum Advanced Java
    Replies: 0
    Last Post: 02-13-2008, 10:31 AM
  4. How to make popups like in eclipse
    By ekadosh in forum SWT / JFace
    Replies: 0
    Last Post: 02-04-2008, 08:58 AM
  5. To make work DLL from webservices
    By Felissa in forum Advanced Java
    Replies: 1
    Last Post: 07-05-2007, 08:07 PM

Posting Permissions

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