I would like to create a test project in Eclipse. My goal is to add AND USE all the class files from the library. How would I do that ? It's this particular library https://github.com/twitter/hbc. I know how to import class files in XCode (Mac/iOS), but whenever I worked with Eclipse it has always been the import which produced the most problems and shied me away. I have tried to drop the master folder into a newly created java-project, however I am not quite sure how to import them (especially because of the folder structure of the library).
-
3Use Maven. It'll make your life a lot easier...ppeterka– ppeterka2013-10-02 11:49:03 +00:00Commented Oct 2, 2013 at 11:49
-
@ppeterka66 what's Maven ?the_critic– the_critic2013-10-02 11:53:27 +00:00Commented Oct 2, 2013 at 11:53
-
1I don't think Google is down... The wiki is also full of info...ppeterka– ppeterka2013-10-02 12:01:24 +00:00Commented Oct 2, 2013 at 12:01
-
"Apache Maven is a software project management and comprehension tool." It can help you manage project dependencies (external Java libraries), and more. maven.apache.orgPsycho Punch– Psycho Punch2013-10-02 12:02:25 +00:00Commented Oct 2, 2013 at 12:02
-
or you can use IvyDE ;)Maciej Cygan– Maciej Cygan2013-10-02 12:56:59 +00:00Commented Oct 2, 2013 at 12:56
1 Answer
right click on your project -> Build Path -> Configure Build Path... On Tab Libraries -> Add JARs... -> select your library .jar file. (must be visible within your workspace, best added to a lib-folder within your project).
otherwise install the Maven Integration for Eclipse plugin and make your project a maven managed project: Help -> Eclipse Marketplace... -> search m2e -> scroll down -> install.
Maven is a Build tool that helps your managing your dependencies. You add your dependency to a library as a short xml text in the pom.xml file and maven downloads and links the library to your project automatically. Read more about it in the documentation.